Skip to content

Instantly share code, notes, and snippets.

@lotherk
Created November 19, 2018 07:21
Show Gist options
  • Save lotherk/71a1f56302fe14c7693a510d350dec2c to your computer and use it in GitHub Desktop.
Save lotherk/71a1f56302fe14c7693a510d350dec2c to your computer and use it in GitHub Desktop.
#!/bin/sh
set -e
DEST="/path/to/dest"
SRCS="/path1 /usr/path2"
INCLUDES=""
for s in $SRCS; do
INCLUDES="${INCLUDES} --include ${s}"
done
DUPLICITY_ARGS="${DUPLICITY_ARGS} ${INCLUDES} --exclude '**'"
DUPLICITY_ARGS="${DUPLICITY_ARGS} --full-if-older-than 7d"
duplicity clean --force $DEST
duplicity --remove-all-but-n-full 2 --force $DEST
duplicity --name $(hostname -f) \
--log-file /var/log/duplicity.log \
$DUPLICITY_ARGS \
$DEST
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment