0

When I use time and date at the end of a crontab line like backup`date +%F_%T`.sql or like backup`date%d%m%y`.sql, my crontab command doesn't work. But when I remove it, it works perfectly.

Why doesn't it work when I use time and date like date%d%m%y?

1
  • The formatting is wrong and very hard to read. Please fix it, and include the exact commands you're running and the exact contents of your crontab.
    – Mikel
    Jan 1, 2016 at 1:40

1 Answer 1

2

First of all you need to escape every % and you should also use a little different syntax with date. So e.g. this one will work just fine:

`date "+\%d\%m\%y"`.sql

Not the answer you're looking for? Browse other questions tagged .