I made a folder ~/mysql/backup and saved the following script as mysql_backup_db (chmod to 700). Change [user], [password] (note NO space between password and flag), and [server] to those you used here: UW MySQL Setup
#!/bin/sh
date=`date -I`
~/mysql/mysqlver/bin/mysqldump -u [user] -p[password] -P [port] -h [server].u.washington.edu --all-databases | gzip > ~/mysql/backup/backup-$date.sql.gz
date=`date -I`
~/mysql/mysqlver/bin/mysqldump -u [user] -p[password] -P [port] -h [server].u.washington.edu --all-databases | gzip > ~/mysql/backup/backup-$date.sql.gz
Then added the following line to my crontab
0 0 * * * [path]/[user]/mysql/backup/mysql_backup_db >/dev/null 2>&1
Tags: No Comments
0 responses so far ↓
There are no comments yet...add one by filling out the form below.