Poll for a file. If not present...Send a alert mail

Dear Experts,

I have a requirement where a 3rd party system places a file in my folder.I am running on HP UNIX. I would like to have a unix script which will check for the existence of the file. If yes OK. if the file is not placed then it has to send a mail to couple of emails ids saying that "File has not been placed."

Please guide me how to develop such a Unix script. I will schedule this script at 9:00AM everyday in the morning.

Thanks,
Phani Akella.

Hi
You can check the file existence in your script as shown below:

   if [ ! -f filename ]
   then
      <code to send mail>
   fi

Regarding the code to send mail, you can search in this forum itself. You will get lots of answers. It is not put here because the code might vary depending upon your flavor of UNIX.

Thanks
Guru.

Hi,

I am running on HP-Unix.

Then search this forum for sending emails in HP-Unix !

tyler_durden