diff options
author | root | 2017-05-17 04:06:27 +0200 |
---|---|---|
committer | root | 2017-05-17 04:06:27 +0200 |
commit | 5bdbcea22a55979bcd4aa21aa4f76c9b818e1511 (patch) | |
tree | 06ab275a2bf501768b0bdf4a9f843c4b2c1c3bd0 /backup-all.sh | |
parent | 118ff790598aebf3c3f11a2ed73f0c842ae83e9c (diff) | |
download | server-utilities-5bdbcea22a55979bcd4aa21aa4f76c9b818e1511.tar.gz |
Add backup scripts
Diffstat (limited to 'backup-all.sh')
-rwxr-xr-x | backup-all.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/backup-all.sh b/backup-all.sh new file mode 100755 index 0000000..aeea10b --- /dev/null +++ b/backup-all.sh | |||
@@ -0,0 +1,24 @@ | |||
1 | #!/bin/sh -euf | ||
2 | |||
3 | usage() ( | ||
4 | echo "backup-all.sh <dataset list> [duplicity options]" | ||
5 | echo | ||
6 | echo "Backups each dataset listed in the given file using Duplicity," | ||
7 | echo "each line of the file being a pair of a dataset name and a Duplicity destination URI." | ||
8 | echo | ||
9 | ) | ||
10 | |||
11 | backup_all() ( | ||
12 | LIST_FILE="$1" | ||
13 | DUPLICITY_OPTIONS="$2" | ||
14 | |||
15 | while read -r LINE; do | ||
16 | backup-dataset.sh $LINE $DUPLICITY_OPTIONS | ||
17 | done <"$LIST_FILE" | ||
18 | ) | ||
19 | |||
20 | case "${1:-help}" in | ||
21 | "help") usage;; | ||
22 | *) backup_all "$1" "${2:-}";; | ||
23 | esac | ||
24 | |||