Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to backup /home/* /root/* and mysql databases to a set of RAIDed drives.

Performance wise I want to do incremental backups.

Would this be the idea?

rsync -al /home /dev/sdb/backups/home

Tricky part. You would have to do a rotate and mysql dump per DB right?

share|improve this question
Look into – Sven Nov 2 '12 at 17:55

Here you go, this will make a nightly backup of home and a back dump of all your mysql data , it will copy the file in to a file named todays date. just mount the new disk and then name it some and adjust the script below , if you have a look at my blog i have the clean script and also one to email you if it hasn't worked.

 # Server Backup
 mkdir -p /storage/backups/`date +\%Y-\%m-\%d`-`date +\%A`/server/users
 rsync -avz /storage/backups/`date --date=yesterday +\%Y-\%m-\%d`-`date --date=yesterday +\%A`/server15/users/ /storage/backups/`date +\%Y-\%m-\%d`-`date +\%A`/server/users/
 rsync -avz --delete rsync -avz /home/ /storage/backups/`date +\%Y-\%m-\%d`-`date +\%A`/server/users/
 # Dump Mysql Data
 for database in $(mysql -u root -p(password) -e "show databases" | awk '{print $1}' | grep -v Database| grep -v information_schema | grep -v mysql | grep -v phpmyadmin)
    mysqldump -u root -p(password) $database > /storage/backups/`date +\%Y-\%m-\%d`-`date +\%A`/server/$database.sql
share|improve this answer
also have a look at my answer for this question… – Paperghost Nov 4 '12 at 11:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.