My cronjob does not work. When it is executed, it gets this error-mail:
/bin/sh: -c: line 0: unexpected EOF while looking for matching `"'
/bin/sh: -c: line 1: syntax error: unexpected end of file
My crontab:
# Delete logfile from last week
00 21 * * * rm /var/log/dumping_$(date -d @$(( $(date "+%s") + 86400 )) "+%u").log
I tried several options, e.g.
00 21 * * * 'rm /var/log/dumping_$(date -d @$(( $(date "+%s") + 86400 )) "+%u").log'
00 21 * * * /bin/bash -c 'rm /var/log/dumping_$(date -d @$(( $(date "+%s") + 86400 )) "+%u").log'
None of them worked as cronjob. It works when I enter it on command-line directly. What's the correct syntax?