The most exciting phrase to hear in science, the one that heralds new discoveries, is not 'Eureka!' but 'That's funny...' --Isaac Asimov
That's Funny… random header image

MySQL daily backups

December 29th, 2008 by eric

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

Then added the following line to my crontab

 0 0 * * * [path]/[user]/mysql/backup/mysql_backup_db >/dev/null 2>&1

Tags: No Comments

Leave A Comment

0 responses so far ↓

  • There are no comments yet...add one by filling out the form below.