Jump to content

Cron Job


Recommended Posts

1) This is the command I use in a cron job to make a backup of my MySQL database each day:

>mysqldump --quick --all --add-drop-table --add-locks --lock-tables --quote-names --user=cpanelname_dbusername --password=dbpassword cpanelname_dbname | gzip -c > /home/cpanelname/path/to/backup/folder/dbname-daily.sql.gz

cpanelname = your CPanel user name

dbusername = your MySQL database user name

dbpassword = your MySQL database password

dbname = your MySQL database name


The mysqldump utility has a lot options - you can read about all of the options it supports in the MySQL documentation for mysqldump.


2) Searching the forums, I found this thread, which discusses MySQL database backups and includes a link to a php script that will make a MySQL database backup and optionally e-mail it to you.


3) Search the forums for mysqldump - there's about a dozen threads with discussion on it and database backups in general.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...