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`" s.o+`hostname`@gmail.com
I need to add it to daily cron.
cron
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`" s.o+`hostname`@gmail.com
I need to add it to daily cron.
Best Answer
You have to escape the
%
signs. They have a special meaning in crontabs: