]> gitweb.fluxo.info Git - puppet-backup.git/commitdiff
add --check support for checking backup status
authordrebs <drebs@riseup.net>
Sat, 12 Dec 2009 22:19:34 +0000 (20:19 -0200)
committerdrebs <drebs@riseup.net>
Sat, 12 Dec 2009 22:19:34 +0000 (20:19 -0200)
templates/dup.conf.erb

index 60a224e337ec51f1067114cd0d1add783c267015..d35e0e2609373edd6b55d4c15440a7d3f82ab745 100644 (file)
@@ -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