From 7bb45ff939c6bca3776950731a61d07f284f0d97 Mon Sep 17 00:00:00 2001 From: Brian King Date: Sun, 31 Mar 2013 01:21:43 +0100 Subject: [PATCH] Let s3cmd have the correct bucket name when using s3 scheme --- duplicity-backup.conf.example | 8 ++++++-- duplicity-backup.sh | 5 +++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/duplicity-backup.conf.example b/duplicity-backup.conf.example index 0d5fb37..cb09289 100644 --- a/duplicity-backup.conf.example +++ b/duplicity-backup.conf.example @@ -90,8 +90,12 @@ ROOT="/home" # for you). If you don't want to use Amazon S3, you can backup # to a file or any of duplicity's supported outputs. # -# NOTE: You do need to keep the "s3+http:///" format -# even though duplicity supports "s3:///". +# The s3+http scheme uses the default aws s3 hostname. +# Use s3://host/bucket/[backup-folder/] if you want to specify the host name. +# If using the s3://... scheme and you have s3cmd installed, be sure to change +# 's3.amazonaws.com' to the appropriate host in your .s3cfg file so that the +# remote file size check will work. +#DEST="s3://host/backup-bucket/backup-folder/" DEST="s3+http://backup-bucket/backup-folder/" # Other possible locations #DEST="ftp://user[:password]@other.host[:port]/some_dir" diff --git a/duplicity-backup.sh b/duplicity-backup.sh index 90d09a0..225523b 100755 --- a/duplicity-backup.sh +++ b/duplicity-backup.sh @@ -331,6 +331,11 @@ get_remote_file_size() "s3") if $S3CMD_AVAIL ; then TMPDEST=$(echo ${DEST} | cut -c 11-) + dest_scheme=$(echo ${DEST} | cut -f -1 -d :) + if [ "$dest_scheme" = "s3" ]; then + # Strip off the host name, too. + TMPDEST=`echo $TMPDEST | cut -f 2- -d /` + fi SIZE=`${S3CMD} du -H s3://${TMPDEST} | awk '{print $1}'` else SIZE="s3cmd not installed."