-
Notifications
You must be signed in to change notification settings - Fork 0
/
duplicity-backup.sh
executable file
·41 lines (33 loc) · 1.02 KB
/
duplicity-backup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env bash
################################################
# ~/git/backup-scripts/duplicity-backup.sh
# Lukas Kallies
# Created: Fr Dec 26, 2014 - Lukas Kallies
# Last modified: Fr Dec 26, 2014 - 17:29
#
# Published under the MIT License (MIT)
################################################
export LC_ALL=C
export PATH="/bin:/usr/bin"
# Where to store the backups? See duplicity(1) URL FORMAT
BACKUPPATH="rsync://root@backup.example.com//backup/${HOSTNAME}"
# ^^ (sic!)
# What to include?
INCLUDE="/etc /root /var /opt /home"
# for asymmetric encryption:
#GPGOPTS="--encrypt-key 01234567"
#
# for symmetric encryption:
GPGOPTS=""
export PASSPHRASE="replaceme"
EXCLUDE=""
for path in ${INCLUDE}; do
# if backing up to /home
if [ "/home" = "${path}" ]; then
EXCLUDE="--exclude ${path}/backup --exclude ${path}/www"
fi
duplicity ${EXCLUDE} ${GPGOPTS} ${path} ${BACKUPPATH}/${path}
EXCLUDE=""
done
exit 0
vim: tabstop=4:softtabstop=4:shiftwidth=4:expandtab