Make a new archive once per minute using "crontab"
Solution 1:
cron
treats %
as newlines. You need to use escape it i.e. use \%
to get literal %
as used in date
.
So you need:
date +"\%Y\%m\%d\%H\%M"
Or you can use a script and use all the commands in the script and call the script from crontab
.
From man 5 crontab
:
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. There is no way to split a single command line onto multiple lines, like the shell's trailing "\".
Solution 2:
Use \%
instead of %
- cron uses %
as a newline.