PDA

View Full Version : Cron Job Backing Up Database Help



jackflash
07-05-2012, 10:29 AM
I'd like to backup my database and have the backup dropped in a folder on my account. In this fashion, I can download it via FTP.

OR

Have the database backup e-mailed to me.

http://www.warnerrobert.com/cron.png

Here's the code that I placed into the Command: line:

mysqldump -udbusername -pdbpassword db_name | gzip > /home/cpanelusername/yourfolder/mysql_backup.gz

I have changed the parts that are in red to reflect my information.

I have also set the folder to 777.

Doesn't seem to be working though. Any ideas or help, please?

Thanks

alemcherry
07-17-2012, 12:41 PM
1. There should be a space after -u and no space after -p. -udbusername is wrong, if that is not a typo.
2. double check the username and password. Try cpanel username and password, which should work on all databases.
3. Try /usr/bin/mysqldump ......
4. Remove the pipe to gzip and try saving it as an sql file, to see if it is gzip that is creating error.