using mysqldump in a cronjob options in the user panel

sandoz

Registered
Mar 13, 2011
1
0
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?
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
43
348
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.