]> gitweb.fluxo.info Git - puppet-backup.git/commitdiff
Adding remove_all_but_n_full for dup action; excluding /root/.cache from backups
authorSilvio Rhatto <rhatto@riseup.net>
Tue, 6 Dec 2011 13:01:17 +0000 (11:01 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Tue, 6 Dec 2011 13:01:17 +0000 (11:01 -0200)
manifests/init.pp
templates/dup.conf.erb

index 6bd8133ea23509dde1344e20615db2e16ec00b3a..f925bd8fc025bbac5061c65ec32dc1412512ee0d 100644 (file)
@@ -26,7 +26,7 @@ $backupdir_remote = "$backupdir/remote"
 
 # for data that's going to be encrypted and signed
 $backup_include_unencrypted = [ "/etc", "/var", "/home", ]
-$backup_exclude_unencrypted = [ "$backupdir_remote", "$backupdir/duplicity", "/var/cache", "/var/log", "/var/vservers", "/var/chroot" ]
+$backup_exclude_unencrypted = [ "$backupdir_remote", "$backupdir/duplicity", "/var/cache", "/var/log", "/var/vservers", "/var/chroot", "/root/.cache" ]
 
 # for data that were previously encrypted and signed
 $backup_include_encrypted = [ "$backupdir/duplicity", ]
@@ -190,6 +190,7 @@ class backup {
                    $ensure = present,
                    $full_if_older_than = "1M",
                    $remove_older_than = "45D",
+                   $remove_all_but_n_full = "1",
                    $periodic_check = absent,
                    $directory = "${backupdir}/duplicity") {
 
index ee58d2f18f5db5bfcb91ecbcaf3c342b0c30abc8..631bf9d5b30d3e2ec72704e7998cb8c79df0992d 100644 (file)
@@ -10,6 +10,7 @@
 BACKUP_FOLDER="<%= directory %>"
 FULL_IF_OLDER_THAN="<%= full_if_older_than %>"
 REMOVE_OLDER_THAN="<%= remove_older_than %>"
+REMOVE_ALL_BUT_N_FULL="<%= remove_all_but_n_full %>"
 ENCRYPT_KEY="<%= encryptkey %>"
 SIGN_KEY="<%= encryptkey %>"
 <% backup_exclude_unencrypted.each do |del| -%> 
@@ -41,6 +42,8 @@ else
   fi
 
   duplicity remove-older-than $REMOVE_OLDER_THAN file:///$BACKUP_FOLDER --force || exit 1
+  duplicity remove-all-but-n-full $REMOVE_ALL_BUT_N_FULL file:///$BACKUP_FOLDER --force || exit 1
+  duplicity cleanup file:///$BACKUP_FOLDER --force || exit 1
 
   if [ "$?" != "0" ]; then
     fatal "Removal of old backups failed."