Last updated

Setting up a backup strategy with Amazon S3

I've recently put a fairly rigorous backup procedure in place for local, staging and production servers. Partly so I don't forget I've written up the process.

Estimated reading time: 1 minutes

Table of contents

#!/bin/bash
rsync -a /var/www/vhosts/ /var/backups/vhosts/
#!/bin/bash
rsync -a --exclude-from="/home/george/exclude.txt" --del -e ssh /var/www/vhosts/  george@1.234.56.789:/mnt/dionysus/backups/shapeshed.com/var/www/vhosts/
rsync -a --del -e ssh /var/backups/mysql/  george@1.234.56.789:/mnt/dionysus/backups/shapeshed.com/var/backups/mysql/
#!/bin/bash
s3cmd sync -r --delete-removed /mnt/dionysus/backups/shapeshed.com/var/backups/mysql/ s3://shapeshed.com/var/backups/mysql/
s3cmd sync -r --delete-removed /mnt/dionysus/backups/shapeshed.com/var/www/vhosts/ s3://shapeshed.com/var/www/vhosts/

Have an update or suggestion for this article? You can edit it here and send me a pull request.

Tags

Recent Posts