crontab sending mail
Ive read articles that use crontab and they have the results mailed to themselves.. but lets go back one step.. lets say I just wanted crotab to mail me.
22 11 * * * mail -s "test" root I checked my email at 11:23 am and nothing so I decided to try this from the prompt: [root@server root]# mail -s "test" root . Cc: Null message body; hope that's ok hmm.. I had to put the extra "." to end the body and still got prompted for a CC:... is this what could be messing up the process? How can I avoid this? The GNUbie |
You might try to give it a small message body. Try:
22 11 * * * echo "Hi there" | mail -s "test" root |
looks like it works |
I hope you understand why the your original cron entry didn't work. You just proved it right there.
When you ran mail -s "Subject" <recipient>, you had to input a '.' and then an <enter> to complete the mail command. Therefore, when you ran it from cron, it was doing the same thing - it was waiting for some sort of input and that's why you never got your mail. -twantrd |
All times are GMT -5. The time now is 04:28 PM. |