Backups are key, here is how to easily backup your server to S3, with duplicity and duplicity-backup. Please be aware that cloud storages are not entirely private and encryption is also needed. With this approach you will have encrypted automatic backups of your files.
In this tutorial I’m using a CentOS
server. First you will need to install duplicity
, s3cmd
.
Run these commands as root
or alternatively prefix the commands with sudo
.
|
|
Next install duplicity-backup.sh. Then copy the sample config file to /etc/duplicity-backup.conf
.
|
|
Edit the config file
|
|
In the last part of the config file you can configure notifications, it’s super useful, please do so.
Create a folder for the logs if it does not exist
|
|
You are all set to create your first backup to S3!
|
|
Configure a cron entry to do the backup procedure automatically
|
|
Add the entry (this will run at 04:04 Monday, Wednesday and Friday)
|
|
After setting all things up you should back up the configuration and the gpg keys in case of server failure, because without the keys and the pass you won’t get your files back. Use the --backup-config
parameter to create a symmetrically encrypted tar of the config and keys. Please save it to a safe place.