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!

using mysqldump in a cronjob options in the user panel

Discussion in 'General Discussion' started by sandoz, Mar 13, 2011.

  1. sandoz

    sandoz Registered

    Joined:
    Mar 13, 2011
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    51
    i would like to automate the backup of a large forum with the cron job options from the cpanel advanced options with something like this:
    0 0 * * * /usr/bin/mysqldump --opt dbname -u dbuser -ppass > /home/username/dbname.sql

    will that work from within the user panel?
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,608
    Likes Received:
    32
    Trophy Points:
    238
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    It would be better to do this in root crontab without using the password and running it as -u root without the -p flag. The root user can run such a cron without being required to enter the password. I'm not certain that it is a good idea to pass the password via a cron.

    To add a cron in root crontab, you can either use "crontab -e" command or directly edit /var/spool/cron/root file in root SSH.
     
    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