Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Cron Job Error: syntax error near unexpected token `('

Discussion in 'General Discussion' started by juliep, Sep 29, 2014.

  1. juliep

    juliep Registered

    Joined:
    Sep 29, 2014
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Hi I have created a cron job via my websites cPanel to backup our mySQL database each week using mysqldump, but I keep getting the following error via my email notification and I can not figure out what the problem is with the command line syntax. The only thing I can think of is there is a '(' character within my password string - could this be causing the problem?

    The error received is:
    /usr/local/cpanel/bin/jailshell: -c: line 0: syntax error near unexpected token `('
    /usr/local/cpanel/bin/jailshell: -c: line 0: `/usr/bin/mysqldump -u myusername -pPassword123](8 mydatabasename > /home/sitefolder/backups/weeklybackup.sql'

    Any help is much appreciated :)

    Julie
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,655
    Likes Received:
    1,787
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello :)

    I suggest setting up a script that completes the database backup, and then simply execute that script in the cron job. It's not a good idea to pass a password in plaintext via a cron job. This is an older thread, but it will give you an idea of how you can accomplish this:

    Backup databases through cron job

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice