[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [cobalt-users] Cron and Email
- Subject: RE: [cobalt-users] Cron and Email
- From: Dom Latter <DLatter@xxxxxxxxxxxxxxx>
- Date: Thu Apr 26 03:28:09 2001
- List-id: Mailing list for users to share thoughts on Cobalt products. <cobalt-users.list.cobalt.com>
> How do I set up a crontab to email me if say a new file comes into the
> ftp/incoming directory?
set up a crontab entry to run a script.
The script could do the following:
mv /tmp/ftplist.current /tmp.ftplist.old
ls -l /ftp/incoming > /tmp/ftplist.current
diff /tmp/ftplist.current /tmp/ftplist.old > /tmp/ftplist.diff
if [ -x /tmp/ftplist.diff ]
mail user@xxxxxxxxxx
fi
That's just an example of an inefficient hack that gets the job done.
I'm not sure about the syntax of the "if" line - you want to
check if the file is not zero-length - and the mail command needs a
flag to send the diff file as the body of the message.
But you can type "man mail" just as well as I can.