| 1 | BACKUP_TARGET="ssh://user@server/.BackupCrypto/backup-name" |
| 2 | export PASSPHRASE=looong-password-fjdshfkasdfhdsfhsdhfsdhfsdhsjdkfjkdsjfdshjfhdsjf |
| 3 | ### DO NOT WRAP THE PASSPHRASE WITH QUOTES, THEY WILL BE TAKEN AS PART OF IT ### |
| 4 | |
| 5 | BACKUP_SOURCE="./" |
| 6 | DFLAGS=--exclude './Makefile' --exclude '**/_*' |
| 7 | DUPLICITY=duplicity |
| 8 | #BACKUP_TARGET="file:///tmp/bkp" |
| 9 | |
| 10 | .PHONY: backup full verify list status cleanup restore help man |
| 11 | |
| 12 | backup: |
| 13 | $(DUPLICITY) $(DFLAGS) $(BACKUP_SOURCE) $(BACKUP_TARGET) |
| 14 | |
| 15 | full: |
| 16 | $(DUPLICITY) full $(DFLAGS) $(BACKUP_SOURCE) $(BACKUP_TARGET) |
| 17 | |
| 18 | verify: |
| 19 | $(DUPLICITY) verify $(DFLAGS) $(BACKUP_TARGET) $(BACKUP_SOURCE) |
| 20 | |
| 21 | list: |
| 22 | $(DUPLICITY) list-current-files $(BACKUP_TARGET) |
| 23 | |
| 24 | status: |
| 25 | $(DUPLICITY) collection-status $(BACKUP_TARGET) |
| 26 | |
| 27 | cleanup: |
| 28 | $(DUPLICITY) cleanup --force $(BACKUP_TARGET) |
| 29 | |
| 30 | restore: |
| 31 | # you can restore your files using this command: |
| 32 | # PASSPHRASE='$(PASSPHRASE)' $(DUPLICITY) restore $(BACKUP_TARGET) /tmp/restored |
| 33 | |
| 34 | man: |
| 35 | man duplicity |
| 36 | |
| 37 | help: |
| 38 | ################################################################### |
| 39 | # |
| 40 | # Makefile for backing-up using duplicity |
| 41 | # --> http://duplicity.nongnu.org/ |
| 42 | # |
| 43 | # make - same as "make backup" |
| 44 | # make backup - backup (full or incremental) |
| 45 | # make full - full backup |
| 46 | # make verify - compare local files with backup |
| 47 | # make list - list files on backup |
| 48 | # make status - print backup status |
| 49 | # make cleanup - remove extraneous files from backup |
| 50 | # make restore - print command to restore files |
| 51 | # make help - print this help |
| 52 | # make man - show duplicity manpage |
| 53 | # |