cron syntax error

Discussion in 'Programming' started by descarte, Nov 28, 2006.

  1. #1
    hi,

    i have this line in the cron file:

    0 0 * * * /usr/local/mysql/bin/mysqldump -uXXX -pXXX -A | gzip > /var/www/html/backup.gz


    I was trying to backup mysql db using crontab but it keeps giving me error with the '|' sign. Anyone knows how to overcome that?

    thanks.
     
    descarte, Nov 28, 2006 IP
  2. Luke

    Luke Peon

    Messages:
    111
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hey Des,

    If you're still having the problem it may because you dont have the route to Gzip path specified or whatever version of cron you are using doesn't like the pipe, in which case either put the whole command in "", or just have it run a shell script which does the command
     
    Luke, Dec 4, 2006 IP
  3. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    #3
    or if u use cpanel goto krakjoe.info and download the cpanel backup tool for free...
     
    krakjoe, Dec 6, 2006 IP