Correction : {host,local,remote}/ : duplicity + MySQL.
[lhc/ateliers.git] / local / backup / duplicity-remove
diff --git a/local/backup/duplicity-remove b/local/backup/duplicity-remove
new file mode 100755 (executable)
index 0000000..5143736
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/sh -eu
+# SYNTAX: $data_dir $find_options -- $duplicity_options
+${TRACE:+set -x}
+
+test "$(id -u)" = "$(id -u backup)"
+
+data_dir=$1; shift
+find_options=
+while [ $# -gt 0 ]
+ do case $1 in
+        (--) shift; break;;
+        (*) find_options="$find_options $1"; shift;;
+        esac
+ done
+
+find ~backup/data/"$data_dir" -mindepth 1 $find_options -type d \
+ -printf '--name\0%P\0file://%p\0' |
+xargs -0rn3 ${TRACE:+-t} ~backup/bin/duplicity "$@"