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

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.



#!/bin/sh

# oldfiles.sh

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


JP