Created
July 11, 2012 15:59
-
-
Save Crhistoph/3091349 to your computer and use it in GitHub Desktop.
Duplicity backup of Maildir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
export PASSPHRASE=mgpgpassphrase | |
export AWS_ACCESS_KEY_ID=mys3accesskey | |
export AWS_SECRET_ACCESS_KEY=mys3secretaccesskey | |
date="date +%d" | |
GPG_KEY="mygpgkey" #Public GPG Key | |
SOURCE="~/Mail" | |
DEST="S3+http://bucketname/backup/" | |
#Backup, sets full rather than incremetal if first of month. | |
if [ "$date" = 01 ] | |
then | |
FULL="full" | |
else | |
FULL="" | |
fi | |
duplicity ${FULL} --encrypt-key=${GPG_KEY} --sign-key=${GPG_KEY} --s3-european-buckets --s3-use-new-style ${SOURCE} ${DEST}>>/var/log/duplicity/mail.log | |
#Delete old backups | |
duplicity remove-older-than 1M --force ${DEST}>>/var/log/duplicity/mail.log | |
#Reset env variables | |
export PASSPHRASE= | |
export AWS_ACCESS_KEY_ID= | |
export AWS_SECRET_ACCESS_KEY= |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment