The following crontab does not work:

*/1 * * * * /bin/echo 'test '`/bin/date +%Y-%m-%d` >> /tmp/test

I also tried starting it with:


Update: I thought the backtick characters ` were the villains, but as the answer below clarifies the percentage % was the culprit!

  • Your test line will run only once each hour. That may not be what you intended for testing.
    – user535733
    Mar 13, 2014 at 23:04
  • isn't the first the minute?# m h dom mon dow command
    – lpanebr
    Mar 14, 2014 at 1:04
  • You are right.. I changed to */1 to make it run every minute.The cron is running fine. There is something with the commands. It seems to be the /bin/date +%Y-%m-%d
    – lpanebr
    Mar 14, 2014 at 1:49

1 Answer 1


In /bin/date +%Y-%m-%d, you need to escape each % with \ according to this man page:

The "sixth" field (the rest of the line) specifies the command to be run. The entire command portion of the line, up to a newline or % character, will be executed by /bin/sh or by the shell specified in the SHELL variable of the cronfile. Percent-signs (%) in the command, unless escaped with backslash (), will be changed into newline characters, and all data after the first % will be sent to the command as standard input.

  • 2
    thanks! I will edit the question so that it fits the real problem.
    – lpanebr
    Mar 14, 2014 at 13:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.