![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| file comparison...help needed. | er_ashu | UNIX for Dummies Questions & Answers | 4 | 05-15-2008 06:37 PM |
| file comparison script | tiger99 | Shell Programming and Scripting | 1 | 01-30-2008 07:47 AM |
| File Comparison | net_shree | Shell Programming and Scripting | 19 | 01-10-2008 05:00 PM |
| Help with time comparison shell script for HP-UX | gummysweets | Shell Programming and Scripting | 6 | 10-12-2005 07:48 AM |
| Newbee Needs Help - Time comparison | danedder | Shell Programming and Scripting | 4 | 05-25-2005 09:26 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
I want a cron job to fire off every 5 minutes or so to verify that a
file in a directory is not more than 15 minutes old (from the current time. If the newest file is more than 15 minutes old, I would fire off an email.. The email part is easy, but I'm having trouble figuring the logic behind the comparison.. Any thoughts? |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Hi,
I knew I'dd seen this question before. The thing is that the command "find" will only count per day (24 hours), so therefor you'dd make a refference file : touch -amt 07231951 /tmp/ref And use the -newer option from find : find /tmp -newer /tmp/ref If it results anything you know it's older, right ? Also a perl-script could help you out a bit. You should do some work still, thought #!/opt/perl/bin/perl $filename = "$ARGV[0]"; @s = stat($filename); $atime = localtime($s[8]); $mtime = localtime($s[9]); $ctime = localtime($s[10); print "Time of the last access (atime) = $atime\n"; print "Time of last inode change (ctime) = $ctime\n"; print "Time of the last modification (mtime) = $mtime\n"; @yourservice David |
|
#3
|
|||
|
|||
|
Thanks !
Thanks for your responce.
|
|||
| Google The UNIX and Linux Forums |