Quantcast
Channel: UNIX and Linux Forums - AIX
Viewing all articles
Browse latest Browse all 373

Email Notification if file exist in AIX

$
0
0
hi,
I want to the AIX to check if file exist everyday and send me notification email.
I added this to the root file in /var/spool/cron/crontabs
Code:

0 10 * * * /usr/sendS40No.sh > /dev/null 2>&1
I tried also
Code:

0 10 * * * /usr/sendS40No.sh
and in the sendS40No.sh i wrote this
Code:

if [ -e "/autoline/REV8/zero/MS/BM/xfer/project/I0000001.H0002351.VTPD PD S040" ]
then
        echo "there is a file. run the reports tomorrow" | mail -v a@something.com
else
        echo "there is No File" | mail -v a@something.com
       
fi

if i will run the file using the sh command im getting the result, but its not running using the cron i dont know why,
have in mind that we are running daily backup using cron and its working fine. but my job is not running..
any advice?

Viewing all articles
Browse latest Browse all 373

Trending Articles