The following command works from prompt but not from crontab.
grep abc /var/log/messages | grep "`date '+%B %d'`" | mail -s"abc log of `hostname`" shantanu.oak+`hostname`@gmail.com
I need to add it to daily cron.
|
The following command works from prompt but not from crontab.
I need to add it to daily cron. |
||||
|
|
|
You have to escape the
|
|||||
|
|
This doesn't directly answer your question, but I would suggest that you create a script file in /usr/local/bin (or ~/bin or whatever is appropriate) and call that from cron. It's easier to test and edit. |
|||
|
|