Why do I get this error
/bin/sh: 1: Syntax error: Unterminated quoted string
when calling this in /etc/crontab
?
19 2 * * * root for f in $(cat /home/rubo77/list); do date +"%y-%m-%d %T">"$f".datefile; done
The list only contains paths to existing directories and those are the first lines in my crontab:
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
When I call the for
commandline on the console in bash I get no errors
%
signs - see this related question: How can I executedate
inside of a cron tab job? – steeldriver Apr 11 '20 at 00:31