```tar cjf foo-`date +%Y%m%d%H%M%S`.tar.bz2 foo
```

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.

解决办法

```* * * * * root tar cjf foo-`date +\%Y\%m\%d\%H\%M\%S`.tar.bz2 foo
```

注意

```* * * * * root tar cjf foo-\$(date +\%Y\%m\%d\%H\%M\%S).tar.bz2 foo
```

参考

1. https://linux.die.net/man/5/crontab
2. https://serverfault.com/questions/84430/whats-wrong-with-my-cronjob-syntax-im-trying-to-use-a-backtick