find yesterday in linux

crontab not working with dynamic date filename – rhel linux

I have done it for so many times, setting a cronjob. Today I was tring to set a simple cronjob which will output the log file with timestamp attached filename. Hourly running cron entry was: 0 * * * * perl demo.pl > demo-out_`date “+%Y-%m-%d_%H-%M”`.log Running the same command on shell prompt was working fine. Execute permissions and path were proper. But it kept on failing to create the proper log!! I changed the crontab as follows, added \ before % to escape and voila!! Things worked !! 0 * * * * perl test.pl > test-out_`date “+\%Y-\%m-\%d_\%H-\%M”`.log A quick lesson....