Duplicity Backup


/ Published in: Bash
Save to your folder(s)



Copy this code and paste it in your HTML
  1. #!/bin/sh
  2. date=`date -I`
  3. day=`date +%d`
  4. bak=~/backup-$date.sql.gz
  5. mysqldump --user=root --password=PASSWORD --all-databases --opt --skip-add-locks | gzip > $bak
  6. ionice -c3 scp -q $bak tr0ycom:~/backups/linode/mysql
  7. ionice -c3 rm $bak
  8.  
  9. export PASSPHRASE=PASSWORD
  10. if [ $day = 01 ]
  11. then
  12. ionice -c3 duplicity --full /home/ scp://tr0ycom/backups/linode/home
  13. ionice -c3 duplicity --remove-older-than 2M /home/ scp://tr0ycom/backups/linode/home
  14. else
  15. ionice -c3 duplicity /home/ scp://tr0ycom/backups/linode/home
  16. fi

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.