Skip to content

Instantly share code, notes, and snippets.

@abingham
Created March 6, 2018 20:56
Show Gist options
  • Save abingham/74e2ad6a666673585c7de34a521cad83 to your computer and use it in GitHub Desktop.
Save abingham/74e2ad6a666673585c7de34a521cad83 to your computer and use it in GitHub Desktop.
Duplicity backup script
#!/bin/bash
# This does a simple local-to-local duplicity backup with no encryption. It keeps backups for a year.
export LOGFILE=<path to log file>
export SOURCE=<path to source directory>
export DEST=<path to destination directory>
# Without this, duplicity gets upset.
ulimit -n 1024
date >> $LOGFILE
/usr/local/bin/duplicity remove-older-than 1Y file://"$SOURCE" >> $LOGFILE
/usr/local/bin/duplicity -v notice --allow-source-mismatch --no-encryption "$SOURCE" file://"$DEST" >> $LOGFILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment