new file notification
pmatulis at sympatico.ca
Sat Feb 17 05:28:26 UTC 2007
Le Vendredi 16 Février 2007 23:35, csevern at pacesetterglobal.com a
> I have been looking for some kind of freebsd software that will
> monitor specific directories and then email notify an email address
> when new files have been added.
> I have searched the ports tree with no success. If anyone has an idea
> of a solution and/or a combanation of ports that will achieve this
> task, i would appreciate it very much.
Why not a simple shell script run with cron?
NEW_FILES=$(ls -al $DIR | grep ^- | wc -l)
if [ $NEW_FILES gt $OLD_FILES ];then
mail -s "new files found in $DIR" user at mail.com < /dev/null
echo $NEW_FILES > $OLD_FILES
More information about the freebsd-questions