[thelist] mysqldump and crontab

Robert Gormley robert at pennyonthesidewalk.com
Sun Apr 9 09:35:22 CDT 2006


The backtick works fine interactively by the command line - but doesn't 
seem to be parsed by cron... is there any equivalent, or do I just need 
to do more escaping?

Rob

Anthony Baratta wrote:
> Did you see your error??
>
> /home/backup/db/`date
>
> You have a back tick in there where it shouldn't be.
>
>
> Robert Gormley wrote:
>   
>> I'm trying to set up a mysqldump job by crontab - problem is, the job 
>> works via command line (bash shell on CentOS 4.3), but errors when run 
>> by crontab.
>>
>> This is the command line:
>>
>> /usr/local/bin/mysqldump -A --user=xxx --password=xxx | /usr/bin/bzip2 
>> -c > /home/backup/db/`date
>>     \+%Y%m%d`.sql.bz2
>>
>> The above works fine.
>> When run through /etc/crontab:
>>
>> 51 6 * * * root /usr/local...
>>
>> I get this error from the Cron Daemon:
>>
>> /bin/bash: -c: line 0: unexpected EOF while looking for matching ``'
>> /bin/bash: -c: line 1: syntax error: unexpected end of file
>>
>> Anyone able to help?
>>
>> Rob
>>
>>     
>
>   





More information about the thelist mailing list