Correction : {host,local,remote}/ : duplicity + MySQL.
[lhc/ateliers.git] / local / backup / mysql-backup
diff --git a/local/backup/mysql-backup b/local/backup/mysql-backup
new file mode 100755 (executable)
index 0000000..cbd0b20
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/sh -eu
+# SYNTAX: $database_pattern -- $duplicity_options
+tool=$(readlink -e "${0%/*}/.")
+${TRACE:+set -x}
+
+database_pattern=$1; shift
+test ! "${1-}" = -- || shift
+
+install -d -m 770 -o backup -g backup \
+ ~backup/archive/mysql \
+ ~backup/data/mysql
+
+test "${TRACE:+set}" || no_print_statistics="-vw --no-print-statistics"
+"$tool"/mysql-snapshot "$database_pattern" \
+ -- "$tool"/duplicity \
+ --name 'mysql/"$database"' \
+ $no_print_statistics \
+ "$@" \
+ ~backup/snapshot/mysql/'"$database"' \
+ file:///home/backup/data/mysql/'"$database"'