I've written a shell script that is SUPER simple and it works fine when I envoke it, but not when it's run by cron.
All the script does is send mail to an address (passes sendmail a file to send the contents of).
When the specified time from crontab rolls around, and I do:
ps -aux | grep send
the sendmail task shows up, and the system log shows it running and returning normal output, but the message never sends.
If I copy-&-paste it from the crontab and just run it from terminal it sends just fine.
Here's the crontab entry:
15 22 * * * root sh /bin/remindermail 2>&1 | tee /var/log/daily.out | mail -s "`hostname' Reminder Text Message Sent to xxxxxxxxx" root
And here's the contents of the remindermail script:
#!/bin/tcsh
sendmail xxx@xxxxxx.xxx < /users/xxxxxxx/ReminderMailMessage.txt
(yes, usernames and such were just replaced with "xxxx" for this posting)
Any ideas?
All the script does is send mail to an address (passes sendmail a file to send the contents of).
When the specified time from crontab rolls around, and I do:
ps -aux | grep send
the sendmail task shows up, and the system log shows it running and returning normal output, but the message never sends.
If I copy-&-paste it from the crontab and just run it from terminal it sends just fine.
Here's the crontab entry:
15 22 * * * root sh /bin/remindermail 2>&1 | tee /var/log/daily.out | mail -s "`hostname' Reminder Text Message Sent to xxxxxxxxx" root
And here's the contents of the remindermail script:
#!/bin/tcsh
sendmail xxx@xxxxxx.xxx < /users/xxxxxxx/ReminderMailMessage.txt
(yes, usernames and such were just replaced with "xxxx" for this posting)
Any ideas?