Reputation: 5193
I have the following cronjob:
2 15 * * * mysqldump -u user -ppass dbname | gzip -9 -c > /var/www/backup/dump-$(date +%Y-%m-%d).sql.gz
but it produces following error:
/bin/sh: -c: line 0: unexpected EOF while looking for matching ')'
/bin/sh: -c: line 1: syntax error: unexpected end of file
I tried ommiting -c
but no luck. I have one more line in my crontab but I don't think it's related:
0 0 * * * find /var/www/backup/* -mtime +15 -exec rm {} \;
Thanks
Upvotes: 2
Views: 1237
Reputation: 185171
The %
character should be escaped in cron
.
So,
2 15 * * * mysqldump -u user -ppass dbname | gzip -9 -c > /var/www/backup/dump-$(date +\%Y-\%m-\%d).sql.gz
Upvotes: 4