
January 28th, 2005, 01:46 AM
|
|
Contributing User
|
|
Join Date: Dec 2004
Location: Prague, Czech Rep.
Posts: 116
  
Time spent in forums: 22 h 34 sec
Reputation Power: 6
|
|
Quote: | Originally Posted by chrs0302 Hi all
We have a script which collects the uptime info of the servers. This info has to be mailed to one of the email addresses of our exchange server. An entry is made in the crontab as follows:
30 9,16 * * * /export/home/test11/upscript > mailx -s "Uptime Info" address@office.ca
We are able to send emails to the same account using mail/mailx utility from the server.
Thanks in advance |
Well, but what is your problem? Does it not work? If a cron job does not work exactly as a command line job, the problem is in its environment. I would call mailx using its absolute path and set the PATH variable the same way as it is when you run it from the command line. You can do it in a small script that encapsulates your cron commad and then you can call this new script from cron.
You can get some hint in the log your cron can have. Look at man cron, man crontab on your system.
Do you get some mail from your cron command? It is handy to store standard output and error output of the cron job into some files and there you can see some indication how to proceed.
Regards 
|