aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2009-08-24 14:06:24 -0300
committerSilvio Rhatto <rhatto@riseup.net>2009-08-24 14:06:24 -0300
commit7b3998d918b08f52db36b3842c1fe28393f41e93 (patch)
tree19ced218d4ec1b3de71c2c03b36cbffd4394fb62 /templates
downloadpuppet-backup-7b3998d918b08f52db36b3842c1fe28393f41e93.tar.gz
puppet-backup-7b3998d918b08f52db36b3842c1fe28393f41e93.tar.bz2
Initial import
Diffstat (limited to 'templates')
-rw-r--r--templates/dup.conf.erb34
1 files changed, 34 insertions, 0 deletions
diff --git a/templates/dup.conf.erb b/templates/dup.conf.erb
new file mode 100644
index 0000000..60a224e
--- /dev/null
+++ b/templates/dup.conf.erb
@@ -0,0 +1,34 @@
+#!/bin/bash
+#
+# This configuration file was auto-generated by the Puppet configuration
+# management system. Any changes you make to this file will be overwritten
+# the next time Puppet runs. Please make configuration changes to this
+# service in Puppet.
+#
+# TODO: custom log file
+
+BACKUP_FOLDER="<%= directory %>"
+FULL_IF_OLDER_THAN="<%= full_if_older_than %>"
+REMOVE_OLDER_THAN="<%= remove_older_than %>"
+ENCRYPT_KEY="<%= encryptkey %>"
+SIGN_KEY="<%= encryptkey %>"
+<% backup_exclude_unencrypted.each do |del| -%>
+EXCLUDE="$EXCLUDE --exclude <%= del %>"
+<% end -%>
+<% backup_include_unencrypted.each do |add| -%>
+INCLUDE="$INCLUDE --include <%= add %>"
+<% end -%>
+
+# some systems have a limited /tmp folder
+TMP="/var/tmp"
+mkdir -p $TMP
+
+export PASSPHRASE="<%= password %>"
+
+# it's important to let $EXCLUDE come before $INCLUDE to
+# have greater precedence; see duplicity(1) for more info
+duplicity -v6 --full-if-older-than $FULL_IF_OLDER_THAN \
+ --tempdir $TMP --encrypt-key $ENCRYPT_KEY --sign-key $SIGN_KEY \
+ --exclude $TMP $EXCLUDE $INCLUDE --exclude '**' / file:///$BACKUP_FOLDER || exit 1
+
+duplicity remove-older-than $REMOVE_OLDER_THAN file:///$BACKUP_FOLDER || exit 1