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..
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
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";