Hello Monks
I am trying to monitor age of directory and alert if it is not modified in last two minutes. I have written following codes
#! /bin/usr/perl my $modified_within = 2 * 60; my $InputDir = "/tmp/KAKA/"; my $LastModified = (stat($InputDir)); my $CurrentTime = time; if ($LastModified->[9] > $CurrentTime - $modified_within) { print "Not Modified in last 2 minute"; } else { print "Modified in last 2 minutes"; }
Though ls -ltr shows that directory had no update since last 10 minute, i keep getting output Modified in last 2 minutes.
What is wrong with my code?
-KAKA
In reply to Age of dir in UNIX by kaka_2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |