Douglas, Stuart wrote:
Excellent, thanks!
One last question...this setup would e-mail you with all changes (writes & deletes in my case); is there a way to only address the writes? We'll live with it if that can't be done, but it would be cool to have if doable.
Actually I set it up to email you the entire directory list. If you want just the files that have changed, then it gets a little more complicated. You have to compare the date of the FTP file to the date that the last sumfile was generated. If the FTP file is newer, then append the filename (and size, etc) to a file. Then mail the file as the message, and delete the file before exitting the script.
# Get the process ID and scriptname and use them to # generate a tempfile name. This method is not garunteed # unique, but it should be Good Enough. pid=$$ scriptname=$(basename $0) mailfile=/tmp/$scriptname.mailfile.$pid
# Check each FTP file to see if it was created or changed # since the last md5sum was generated. for ftpfile in $(ls $watchdir); do if [ $ftpfile -nt $sumfile ]; then ls --fulltime $myfile >> $mailfile
That line should read
ls --fulltime $ftpfile >> $mailfile
Tony -- Anthony E. Greene <mailto:[EMAIL PROTECTED]> OpenPGP Key: 0x6C94239D/7B3D BD7D 7D91 1B44 BA26 C484 A42A 60DD 6C94 239D AOL/Yahoo Chat: TonyG05 HomePage: <http://www.pobox.com/~agreene/> Linux. The choice of a GNU generation. <http://www.linux.org/>
-- redhat-list mailing list unsubscribe mailto:[EMAIL PROTECTED] https://listman.redhat.com/mailman/listinfo/redhat-list