aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authordrebs <drebs@riseup.net>2009-12-12 20:19:34 -0200
committerdrebs <drebs@riseup.net>2009-12-12 20:19:34 -0200
commit5afa00d457e26062d13dca4230ce689b254a2a3d (patch)
tree87eb7282f046f5e714786697bcb09347a0471228 /templates
parent1187241365f98231643254ac6cfce18f91f97f7f (diff)
downloadpuppet-backup-5afa00d457e26062d13dca4230ce689b254a2a3d.tar.gz
puppet-backup-5afa00d457e26062d13dca4230ce689b254a2a3d.tar.bz2
add --check support for checking backup status
Diffstat (limited to 'templates')
-rw-r--r--templates/dup.conf.erb19
1 files changed, 12 insertions, 7 deletions
diff --git a/templates/dup.conf.erb b/templates/dup.conf.erb
index 60a224e..d35e0e2 100644
--- a/templates/dup.conf.erb
+++ b/templates/dup.conf.erb
@@ -25,10 +25,15 @@ 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
+# adds support for checking the existing backup
+if [ "$1" == "--check"]; then
+ duplicity collection-status file:///$BACKUP_FOLDER
+else
+ # 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
+fi