Differences between revisions 2 and 3
Revision 2 as of 2007-05-16 16:01:10
Size: 559
Editor: GreyCat
Comment: % in crontab
Revision 3 as of 2008-11-22 14:08:53
Size: 559
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
[[Anchor(faq43)]] <<Anchor(faq43)>>

Why does my crontab job fail? 0 0 * * * some command > /var/log/mylog.`date +%Y%m%d`

In many versions of crontab, the percent sign (%) is treated specially, and therefore must be escaped with backslashes.

{{{0 0 * * * some command > /var/log/mylog.date +\%Y\%m\%d }}}

See your system's manual (crontab(5) or crontab(1)) for details. Note: on systems which split the crontab manual into two parts, you may have to type man 5 crontab or man -s 5 crontab to read the part you need.

BashFAQ/043 (last edited 2014-04-29 02:10:28 by ormaaj)