[thelist] mysqldump and crontab
Hassan Schroeder
hassan at webtuitive.com
Sun Apr 9 10:20:58 CDT 2006
Robert Gormley wrote:
> 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?
By default, cron runs /bin/sh, not bash -- subtle differences, but...
>>>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)
>>>/usr/local/bin/mysqldump -A --user=xxx --password=xxx | /usr/bin/bzip2
>>>-c > /home/backup/db/`date
>>> \+%Y%m%d`.sql.bz2
I'd first try putting the full path of `date` in there; if that's
no help, put the entire command in a shell script and invoke *that*
from cron.
Just for grins, I made a shell script from this, adjusted for local
conditions :-) and ran that from cron successfully (SuSE 9.1).
HTH!
--
Hassan Schroeder ----------------------------- hassan at webtuitive.com
Webtuitive Design === (+1) 408-938-0567 === http://webtuitive.com
opinion: webtuitive.blogspot.com
dream. code.
More information about the thelist
mailing list