Cron truncating command lines when date command with format controls used
Issue
-
cronappears to be truncating the command line so the job does not complete/run. -
Add
cronjobs which use the date command like these:
34 10 * * * date +%m > /tmp/nb1
34 10 * * * date '+%m' > /tmp/nb2
34 10 * * * date "+%m" > /tmp/nb3
- The jobs when run but not create the files in
/tmp.cronlog showscronis truncating the command line before running it.
CROND[11853]: ($NAME) CMD (date +)
CROND[11855]: ($NAME) CMD (date '+)
CROND[11857]: ($NAME) CMD (date "+)
- If format controls are not used, full command is executed.
Environment
- Red Hat Enterprise Linux 5
- Red Hat Enterprise Linux 6
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
