1753301 Members
7120 Online
108792 Solutions
New Discussion юеВ

Notify mail if have file

 
ivy1234
Frequent Advisor

Notify mail if have file

I have a file , there are many files will be created in it and then move it to other directory , can advise if I want to have a notify mail when there is a file in it , what can I do ? thx
2 REPLIES 2
Dennis Handly
Acclaimed Contributor

Re: Notify mail if have file

You can set up a crontab entry that looks for files in your directory.
The entry can either do it every so often or you can put sleep in the script and have it started once.
johnsonpk
Honored Contributor

Re: Notify mail if have file

Hi ,
As Dennis suggested setup a cron entry to execute a script to check the existence

if [ -f your_filename ]
then
sendmail -s "file found" you@yourdomain.com
fi


Regards!
Johnson