Compare commits
13 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c78676ab9d | ||
|
|
2dec3ed145 | ||
|
|
c56e78a463 | ||
|
|
27785d0ad0 | ||
|
|
4dd6ed1ee2 | ||
|
|
5cad03cb3e | ||
|
|
f71dd556dc | ||
|
|
77ecc4318f | ||
|
|
99b2512789 | ||
|
|
4779ee4d1b | ||
|
|
96a64148fd | ||
|
|
6140c226db | ||
|
|
18ef8983aa |
5 changed files with 49 additions and 22 deletions
|
|
@ -3,12 +3,8 @@ language: bash
|
||||||
# Use container-based infrastructure for quicker build start-up
|
# Use container-based infrastructure for quicker build start-up
|
||||||
sudo: false
|
sudo: false
|
||||||
|
|
||||||
addons:
|
before_script:
|
||||||
apt:
|
- shellcheck --version
|
||||||
sources:
|
|
||||||
- debian-sid
|
|
||||||
packages:
|
|
||||||
- shellcheck
|
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- shellcheck -e SC2034 duplicity-backup.sh duplicity-backup.conf.example
|
- shellcheck -e SC2034 duplicity-backup.sh duplicity-backup.conf.example
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
vX.X.X (unreleased)
|
vX.X.X (unreleased)
|
||||||
===================
|
===================
|
||||||
* Placeholder for next release
|
|
||||||
|
v1.6.0 (2018-05-22)
|
||||||
|
===================
|
||||||
|
* Add support for Dropbox backend (by xmatthias)
|
||||||
|
* Fix issue #177: bug in `--cleanup` action (thanks smcgrat)
|
||||||
|
|
||||||
v1.5.0 (2018-01-15)
|
v1.5.0 (2018-01-15)
|
||||||
===================
|
===================
|
||||||
|
|
@ -12,7 +16,7 @@ v1.4.3 (2017-10-30)
|
||||||
|
|
||||||
v1.4.2 (2017-10-30)
|
v1.4.2 (2017-10-30)
|
||||||
===================
|
===================
|
||||||
* Remove VERSION file and hardcode it directly in the script.
|
* Remove VERSION file and hardcode it directly in the script. Fix issue #164 (thanks regelga)
|
||||||
|
|
||||||
v1.4.1 (2017-10-04)
|
v1.4.1 (2017-10-04)
|
||||||
===================
|
===================
|
||||||
|
|
|
||||||
10
README.md
10
README.md
|
|
@ -68,23 +68,23 @@ You can clone the repository (which makes it easy to get future updates):
|
||||||
|
|
||||||
git clone https://github.com/zertrin/duplicity-backup.sh.git duplicity-backup
|
git clone https://github.com/zertrin/duplicity-backup.sh.git duplicity-backup
|
||||||
|
|
||||||
If you prefer the stable version do:
|
If you prefer the stable (but old) version do:
|
||||||
|
|
||||||
git checkout stable
|
git checkout stable
|
||||||
|
|
||||||
... or if you want the latest version (might still have bugs), then:
|
... or if you want the normal version, then:
|
||||||
|
|
||||||
git checkout master
|
git checkout master
|
||||||
|
|
||||||
... or if you like living on the edge, you can stay at the development version which is automatically cloned.
|
... or if you like living on the edge (or need the latest bugfixes), you can stay at the development version which is automatically cloned.
|
||||||
|
|
||||||
Or just download the ZIP file:
|
Or just download the ZIP file:
|
||||||
|
|
||||||
| Version | Download link |
|
| Version | Download link |
|
||||||
|---------------|-------------------------------------------------------------------|
|
|---------------|-------------------------------------------------------------------|
|
||||||
| stable | https://github.com/zertrin/duplicity-backup.sh/archive/stable.zip |
|
| stable (old) | https://github.com/zertrin/duplicity-backup.sh/archive/stable.zip |
|
||||||
| normal | https://github.com/zertrin/duplicity-backup.sh/archive/master.zip |
|
| normal | https://github.com/zertrin/duplicity-backup.sh/archive/master.zip |
|
||||||
| bleeding-edge | https://github.com/zertrin/duplicity-backup.sh/archive/dev.zip |
|
| latest | https://github.com/zertrin/duplicity-backup.sh/archive/dev.zip |
|
||||||
|
|
||||||
### 2. Configure the script
|
### 2. Configure the script
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
#
|
#
|
||||||
# Copyright (c) 2008-2010 Damon Timm.
|
# Copyright (c) 2008-2010 Damon Timm.
|
||||||
# Copyright (c) 2010 Mario Santagiuliana.
|
# Copyright (c) 2010 Mario Santagiuliana.
|
||||||
# Copyright (c) 2012-2016 Marc Gallet.
|
# Copyright (c) 2012-2018 Marc Gallet.
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify it under
|
# This program is free software: you can redistribute it and/or modify it under
|
||||||
# the terms of the GNU General Public License as published by the Free Software
|
# the terms of the GNU General Public License as published by the Free Software
|
||||||
|
|
@ -108,13 +108,13 @@ DEST="s3+http://foobar-backup-bucket/backup-folder/"
|
||||||
#DEST="ftpes://user[:password]@other.host[:port]/some_dir"
|
#DEST="ftpes://user[:password]@other.host[:port]/some_dir"
|
||||||
#DEST="rsync://user@host.com[:port]//absolute_path"
|
#DEST="rsync://user@host.com[:port]//absolute_path"
|
||||||
#DEST="scp://user[:password]@other.host[:port]/[/]some_dir"
|
#DEST="scp://user[:password]@other.host[:port]/[/]some_dir"
|
||||||
#DEST="ssh://user[:password]@other.host[:port]/[/]some_dir"
|
|
||||||
#DEST="sftp://user[:password]@other.host[:port]/[/]some_dir"
|
#DEST="sftp://user[:password]@other.host[:port]/[/]some_dir"
|
||||||
#DEST="file:///home/foobar_user_name/new-backup-test/"
|
#DEST="file:///home/foobar_user_name/new-backup-test/"
|
||||||
#DEST="imap[s]://user[:password]@host.com[/from_address_prefix]"
|
#DEST="imap[s]://user[:password]@host.com[/from_address_prefix]"
|
||||||
#DEST="webdav[s]://user[:password]@other.host[:port]/some_dir"
|
#DEST="webdav[s]://user[:password]@other.host[:port]/some_dir"
|
||||||
#DEST="gdocs://foobar_google_account/some_dir"
|
#DEST="gdocs://foobar_google_account/some_dir"
|
||||||
#DEST="swift://foobar_swift_container/some_dir"
|
#DEST="swift://foobar_swift_container/some_dir"
|
||||||
|
#DEST="dpbx:///foobar_swift_container/some_dir"
|
||||||
#DEST="b2://some_account_id[:some_application_key]@some_bucket_name/some_dir"
|
#DEST="b2://some_account_id[:some_application_key]@some_bucket_name/some_dir"
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -174,6 +174,13 @@ DEST="s3+http://foobar-backup-bucket/backup-folder/"
|
||||||
#SWIFT_AUTHURL="foobar_swift_authurl"
|
#SWIFT_AUTHURL="foobar_swift_authurl"
|
||||||
#SWIFT_AUTHVERSION="2"
|
#SWIFT_AUTHVERSION="2"
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# DROPBOX INFORMATION
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# Uncomment these lines if you're using Dropbox
|
||||||
|
#
|
||||||
|
#DPBX_ACCESS_TOKEN="foobar_dropbox_access_token"
|
||||||
|
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# INCLUDE LIST OF DIRECTORIES
|
# INCLUDE LIST OF DIRECTORIES
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
#
|
#
|
||||||
# Copyright (c) 2008-2010 Damon Timm.
|
# Copyright (c) 2008-2010 Damon Timm.
|
||||||
# Copyright (c) 2010 Mario Santagiuliana.
|
# Copyright (c) 2010 Mario Santagiuliana.
|
||||||
# Copyright (c) 2012-2017 Marc Gallet.
|
# Copyright (c) 2012-2018 Marc Gallet.
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify it under
|
# This program is free software: you can redistribute it and/or modify it under
|
||||||
# the terms of the GNU General Public License as published by the Free Software
|
# the terms of the GNU General Public License as published by the Free Software
|
||||||
|
|
@ -45,7 +45,7 @@ CONFIG="duplicity-backup.conf"
|
||||||
# Script Happens Below This Line - Shouldn't Require Editing #
|
# Script Happens Below This Line - Shouldn't Require Editing #
|
||||||
##############################################################
|
##############################################################
|
||||||
|
|
||||||
DBSH_VERSION="v1.5.0"
|
DBSH_VERSION="v1.6.0"
|
||||||
|
|
||||||
# make a backup of stdout and stderr for later
|
# make a backup of stdout and stderr for later
|
||||||
exec 6>&1
|
exec 6>&1
|
||||||
|
|
@ -191,7 +191,7 @@ while getopts ":c:t:bfvelsqndhV-:" opt; do
|
||||||
QUIET=1
|
QUIET=1
|
||||||
;;
|
;;
|
||||||
dry-run)
|
dry-run)
|
||||||
DRY_RUN="--dry-run "
|
DRY_RUN="--dry-run"
|
||||||
;;
|
;;
|
||||||
debug)
|
debug)
|
||||||
ECHO=$(which echo)
|
ECHO=$(which echo)
|
||||||
|
|
@ -218,7 +218,7 @@ while getopts ":c:t:bfvelsqndhV-:" opt; do
|
||||||
l) COMMAND="list-current-files";;
|
l) COMMAND="list-current-files";;
|
||||||
s) COMMAND="collection-status";;
|
s) COMMAND="collection-status";;
|
||||||
q) QUIET=1;;
|
q) QUIET=1;;
|
||||||
n) DRY_RUN="--dry-run ";; # dry run
|
n) DRY_RUN="--dry-run";; # dry run
|
||||||
d) ECHO=$(which echo);; # debug
|
d) ECHO=$(which echo);; # debug
|
||||||
h)
|
h)
|
||||||
usage
|
usage
|
||||||
|
|
@ -342,7 +342,13 @@ fi
|
||||||
|
|
||||||
# ------------------------- Setting up variables ------------------------
|
# ------------------------- Setting up variables ------------------------
|
||||||
|
|
||||||
STATIC_OPTIONS="${DRY_RUN}${STATIC_OPTIONS}"
|
if [ -n "${DRY_RUN}" ]; then
|
||||||
|
STATIC_OPTIONS="${DRY_RUN} ${STATIC_OPTIONS}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "${STORAGECLASS}" ]; then
|
||||||
|
STATIC_OPTIONS="${STATIC_OPTIONS} ${STORAGECLASS}"
|
||||||
|
fi
|
||||||
|
|
||||||
SIGN_PASSPHRASE=${PASSPHRASE}
|
SIGN_PASSPHRASE=${PASSPHRASE}
|
||||||
|
|
||||||
|
|
@ -354,6 +360,7 @@ export SWIFT_USERNAME
|
||||||
export SWIFT_PASSWORD
|
export SWIFT_PASSWORD
|
||||||
export SWIFT_AUTHURL
|
export SWIFT_AUTHURL
|
||||||
export SWIFT_AUTHVERSION
|
export SWIFT_AUTHVERSION
|
||||||
|
export DPBX_ACCESS_TOKEN
|
||||||
export PASSPHRASE
|
export PASSPHRASE
|
||||||
export SIGN_PASSPHRASE
|
export SIGN_PASSPHRASE
|
||||||
|
|
||||||
|
|
@ -448,6 +455,12 @@ else
|
||||||
DEST_IS_S3=false
|
DEST_IS_S3=false
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$(echo "${DEST}" | cut -c 1,4)" = "dpbx" ]; then
|
||||||
|
DEST_IS_DPBX=true
|
||||||
|
else
|
||||||
|
DEST_IS_DPBX=false
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$(echo "${DEST}" | cut -c 1,2)" = "b2" ]; then
|
if [ "$(echo "${DEST}" | cut -c 1,2)" = "b2" ]; then
|
||||||
DEST_IS_B2=true
|
DEST_IS_B2=true
|
||||||
B2CMD="$(which b2)"
|
B2CMD="$(which b2)"
|
||||||
|
|
@ -481,6 +494,8 @@ check_variables ()
|
||||||
config_sanity_fail "An s3 DEST has been specified, but AWS_ACCESS_KEY_ID or AWS_SECRET_ACCESS_KEY have not been configured"
|
config_sanity_fail "An s3 DEST has been specified, but AWS_ACCESS_KEY_ID or AWS_SECRET_ACCESS_KEY have not been configured"
|
||||||
[[ ( ${DEST_IS_GS} = true && (${GS_ACCESS_KEY_ID} = "foobar_gcs_key_id" || ${GS_SECRET_ACCESS_KEY} = "foobar_gcs_secret_id" )) ]] && \
|
[[ ( ${DEST_IS_GS} = true && (${GS_ACCESS_KEY_ID} = "foobar_gcs_key_id" || ${GS_SECRET_ACCESS_KEY} = "foobar_gcs_secret_id" )) ]] && \
|
||||||
config_sanity_fail "A Google Cloud Storage DEST has been specified, but GS_ACCESS_KEY_ID or GS_SECRET_ACCESS_KEY have not been configured"
|
config_sanity_fail "A Google Cloud Storage DEST has been specified, but GS_ACCESS_KEY_ID or GS_SECRET_ACCESS_KEY have not been configured"
|
||||||
|
[[ ( ${DEST_IS_DPBX} = true && (${DPBX_ACCESS_TOKEN} = "foobar_dropbox_access_token" )) ]] && \
|
||||||
|
config_sanity_fail "A Dropbox DEST has been specified, but DPBX_ACCESS_TOKEN has not been configured"
|
||||||
[[ ! -z "${INCEXCFILE}" && ! -f ${INCEXCFILE} ]] && config_sanity_fail "The specified INCEXCFILE ${INCEXCFILE} does not exists"
|
[[ ! -z "${INCEXCFILE}" && ! -f ${INCEXCFILE} ]] && config_sanity_fail "The specified INCEXCFILE ${INCEXCFILE} does not exists"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -825,7 +840,6 @@ duplicity_backup()
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
eval "${ECHO}" "${DUPLICITY}" "${OPTION}" "${VERBOSITY}" "${STATIC_OPTIONS}" \
|
eval "${ECHO}" "${DUPLICITY}" "${OPTION}" "${VERBOSITY}" "${STATIC_OPTIONS}" \
|
||||||
"${STORAGECLASS}" \
|
|
||||||
"${ENCRYPT}" \
|
"${ENCRYPT}" \
|
||||||
"${EXCLUDE}" \
|
"${EXCLUDE}" \
|
||||||
"${INCLUDE}" \
|
"${INCLUDE}" \
|
||||||
|
|
@ -840,6 +854,7 @@ duplicity_cleanup_failed()
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
eval "${ECHO}" "${DUPLICITY}" "${OPTION}" "${VERBOSITY}" "${STATIC_OPTIONS}" \
|
eval "${ECHO}" "${DUPLICITY}" "${OPTION}" "${VERBOSITY}" "${STATIC_OPTIONS}" \
|
||||||
|
"${ENCRYPT}" \
|
||||||
"${DEST}"
|
"${DEST}"
|
||||||
} || {
|
} || {
|
||||||
BACKUP_ERROR=1
|
BACKUP_ERROR=1
|
||||||
|
|
@ -1004,7 +1019,7 @@ case "${COMMAND}" in
|
||||||
OPTION="cleanup"
|
OPTION="cleanup"
|
||||||
|
|
||||||
if [ -z "${DRY_RUN}" ]; then
|
if [ -z "${DRY_RUN}" ]; then
|
||||||
STATIC_OPTIONS="--force"
|
STATIC_OPTIONS="${STATIC_OPTIONS} --force"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e "-------[ Cleaning up Destination ]-------\n"
|
echo -e "-------[ Cleaning up Destination ]-------\n"
|
||||||
|
|
@ -1151,6 +1166,11 @@ unset AWS_ACCESS_KEY_ID
|
||||||
unset AWS_SECRET_ACCESS_KEY
|
unset AWS_SECRET_ACCESS_KEY
|
||||||
unset GS_ACCESS_KEY_ID
|
unset GS_ACCESS_KEY_ID
|
||||||
unset GS_SECRET_ACCESS_KEY
|
unset GS_SECRET_ACCESS_KEY
|
||||||
|
unset SWIFT_USERNAME
|
||||||
|
unset SWIFT_PASSWORD
|
||||||
|
unset SWIFT_AUTHURL
|
||||||
|
unset SWIFT_AUTHVERSION
|
||||||
|
unset DPBX_ACCESS_TOKEN
|
||||||
unset PASSPHRASE
|
unset PASSPHRASE
|
||||||
unset SIGN_PASSPHRASE
|
unset SIGN_PASSPHRASE
|
||||||
unset FTP_PASSWORD
|
unset FTP_PASSWORD
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue