Skip to content

Instantly share code, notes, and snippets.

@vicentebolea
Created November 20, 2019 22:19
Show Gist options
  • Select an option

  • Save vicentebolea/6a1ec0fbe6cce7f06aa9fd08ebc01511 to your computer and use it in GitHub Desktop.

Select an option

Save vicentebolea/6a1ec0fbe6cce7f06aa9fd08ebc01511 to your computer and use it in GitHub Desktop.
# Setup those vars at /etc/environment
# PASSPHRASE=
# GS_ACCESS_KEY_ID=
# GS_SECRET_ACCESS_KEY=
# GS_REMOTE=
set -x
SOURCES=(
"/etc"
"/usr/local"
"/var/lib/"
"/var/adm/"
"/var/mail/"
)
CACHE_DIR=/tmp/duplicity-cache
PERIOD=3M
for path in "${SOURCES[@]}"; do
duplicity --archive-dir $CACHE_DIR --full-if-older 1M --exclude /var/lib/lxcfs /var/$path $REMOTE$path
duplicity remove-older-than $PERIOD $REMOTE$path
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment