Automated MySQL Database Backup

Want to backup your MySQL databases to another machine on a nightly basis?
Then create a /etc/cron.daily/mysqlbackup.sh job like this:

mysqldump --compress -u root -p$pw -h $currenthost --add-drop-table --extended-insert --quote-names --databases db1 db2| mysql -u root -p$pw -h $remotehost

Run chmod +x /etc/cron.daily/mysqlbackup.sh. And change the $ parameters to the appropriate ‘real’ values.

(from Internet)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s