Skip to content

Instantly share code, notes, and snippets.

@edhemphill edhemphill/backup-to-s3.sh
Last active Dec 13, 2016

Embed
What would you like to do?
Use Duplicati for Backup to S3 on Ubuntu Server
#!/bin/bash
#
# You need Duplicati installed
# First on Ubuntu it uses mono :( unfortunately:
# apt-get install mono-runtime
# get the latest Duplicati 2.0 - go here--> http://www.duplicati.com/download
# wget https://updates.duplicati.com/experimental/duplicati_2.0.1.30-1_all.deb
# sudo dpkg -i duplicati_2.0.1.30-1_all.deb
#
# After install you will have a 'duplicati-cli' which is a script which runs the mono program: Duplicati.CommandLine.exe
#
# For more info: duplicati-cli help backup & duplicati-cli help s3
# backup to an s3 bucket:
BUCKET_NAME="my-backup"
BUCKET_FOLDER="backups"
AWS_SECRET_KEY="xxxxxx-LONGER-ONE:)-xxxxxx"
AWS_ACCESS_KEY="ABCDEFGHXXXXXX"
BACKUP_DIR="backup-this-dir"
duplicati-cli \
--aws_secret_access_key=\"${AWS_SECRET_KEY}\" \
--aws_access_key_id=\"${AWS_ACCESS_KEY}\" \
--s3-ext-signatureversion=4 \
--use-ssl \
--s3-location-constraint=us-east-1 \
backup s3://${BUCKET_NAME}/${BUCKET_FOLDER} ${BACKUP_DIR}
# the --s3-ext-signatureversion=4 is needed if the bucket is in a newer region.
# ISSUES: There seems to be a problem uploading to us-east-2. I filed a ticket here: https://github.com/duplicati/duplicati/issues/2175
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.