This is regarding my cron job. My cron entry
30 * * * 1-5,0 /work1/informix/sample/script1.sh
31 * * * 1-5,0 /work1/informix/sample/script2.sh
Every 30 mins script1.sh is run. (mon thru friday and sunday)
Every 30 mins script2.sh is run. (mon thru friday and sunday)
This is based on the thread
(
https://www.unix.com/unix-dummies-que...ttachment.html). Thanks to folks who helped me out. The system guys started the cron and sendmail daemon and so i could get the mailx work.
script1.sh
onstat -d > /work1/informix/sample/track.txt
onstat -l >> /work1/informix/sample/track.txt
script2.sh
mailx -s "Informix Database Status & LogFile Status" 'name1@mydomain.com, name2@mydomain.com' < /work1/informix/sample/track.txt
I did execute the script2 manually from command line and it worked.
After monitoring:
Issue1:
I found that the cron job does execute, but when i check the file track.txt in the directory its generated every 1 hour. I have set the cron job for every 30 mins. I would require the cron job to do the work every 30 mins and not at 1 hour.
Issue2:
Any reason for the error:
But when cron job executed after 1 hour, i got the following in /var/mail/informix file
Your "cron" job on sun-350 (machine name: sun-350)
/work1/informix/sample/script2.sh
produced the following output:
/work1/informix/sample/script2.sh: track.txt: cannot open
So now i have included the full path and in script2.sh
(earlier my entry was
mailx -s "Informix Database Status & LogFile Status" 'name1@mydomain.com, name2@mydomain.com' < track.txt)
Iam missing something, do point me to correct direction!
thanks