crontab doesn't allow `command` ??

Dear All,

We wrote a script to clean email mailbox when they're nearly full and put it in cron :

0 0 * * * /root/quota/autoclean.sh > /root/quota/autoclean.`date '+%Y%m%d'` 2>&1

I've run this command from command prompt, it did work.
However, if running from cron, it returned such error in log :

/var/log/cron.1:Sep 18 05:00:01 mail1 crond[28695]: (root) CMD (/root/quota/autoclean.sh > /root/quota/autoclean.`date '+)

Could someone advise what's the reason for this?
Thanks.

Hi tiger2000,

It happened to me once and it took me a while to figure it out. The probleme comes from the %. I have no idea why but for some reason, in the crontab, they must be escaped. Try:

0 0 * * * /root/quota/autoclean.sh > /root/quota/autoclean.`date '+\%Y\%m\%d'` 2>&1