Honored Contributor Honored Contributor
Re: Need Script to monitor file transfer has occurred

That sure seems like a lot of work, especially for somebody as lazy as I am. :)

I thought about it and I came up with a little shell script that seems to work. I just use the 'touch' command to touch a file, sleep for 60 seconds, and then use the 'find' command to find any files older (actually not newer) than the file I touched. If I do, I e-mail a list of the files I found. The "reference" file can live anywhere, if you don't want it in your current directory.


# oldfiles.sh

while true
touch reference.file
sleep 60
find . ! -newer reference.file -name "*.udf204.gwn" >/var/tmp/oldfiles
if [[ -s /var/tmp/oldfiles ]];
mailx -s "Files older than 1 minute found!" jpoff fi