#!/usr/bin/perl -w use warnings; use strict; ############### # CONFIG VARS # ############### my $dir_to_watch = "/cygdrive/c/WATCHDOG"; my $timeout = 120; # Max file age (sec) my $awhile = 30; # Checking interval (sec) #-------------------------------------------------- # Sends contents of specified file to admin sub send_msg { my $fn = shift; print "You'd send $fn via EMail here...\n"; } chdir $dir_to_watch; while (1) { for (`ls`) { chomp; my $age = time - (stat)[9]; send_msg($_) if $age > $timeout; } sleep $awhile; }