]> git.sven.stormbind.net Git - sven/scripts.git/commitdiff
add a more aggressive cleanup for duplicity to avoid local and remote cache growth
authorSven Hoexter <sven@timegate.de>
Sun, 9 Oct 2011 07:49:49 +0000 (09:49 +0200)
committerSven Hoexter <sven@timegate.de>
Sun, 9 Oct 2011 07:49:49 +0000 (09:49 +0200)
hetzner/hetznerbackupv2.sh

index cd0e8306f412a2280269799227822c074a529ce4..2ceb473d2e88c89cf28d57691db6030a5a63db58 100755 (executable)
@@ -27,19 +27,23 @@ job_main() {
     echo "Going for /etc" >> $SESSIONLOG
     duplicity $BMODE $dry /etc $PROTO://$FTP_USER@$FTP_HOST/main/etc >> $SESSIONLOG 2>&1 || ERRSTAT=1
     duplicity remove-all-but-n-full 5 --force $dry $PROTO://$FTP_USER@$FTP_HOST/main/etc >> $SESSIONLOG 2>&1 || ERRSTAT=1
+    duplicity cleanup --extra-clean --force $dry $PROTO://$FTP_USER@$FTP_HOST/main/etc >> $SESSIONLOG 2>&1 || ERRSTAT=1
 
     echo "Going for /home" >> $SESSIONLOG
     duplicity $BMODE $dry /home $PROTO://$FTP_USER@$FTP_HOST/main/home >> $SESSIONLOG 2>&1  || ERRSTAT=1
     duplicity remove-all-but-n-full 5 --force $dry $PROTO://$FTP_USER@$FTP_HOST/main/home >> $SESSIONLOG 2>&1 || ERRSTAT=1 
+    duplicity cleanup --extra-clean --force $dry $PROTO://$FTP_USER@$FTP_HOST/main/home >> $SESSIONLOG 2>&1 || ERRSTAT=1
 
     echo "Going for /var/www" >> $SESSIONLOG
     duplicity $BMODE $dry /var/www $PROTO://$FTP_USER@$FTP_HOST/main/var/www >> $SESSIONLOG 2>&1  || ERRSTAT=1
     duplicity remove-all-but-n-full 5 --force $dry $PROTO://$FTP_USER@$FTP_HOST/main/var/www >> $SESSIONLOG 2>&1  || ERRSTAT=1
+    duplicity cleanup --extra-clean --force $dry $PROTO://$FTP_USER@$FTP_HOST/main/var/www >> $SESSIONLOG 2>&1 || ERRSTAT=1
 
     echo "Going for /var/lib/automysqlbackup" >> $SESSIONLOG
     if [ -e /var/lib/automysqlbackup/backupdone ]; then
            duplicity $BMODE $dry /var/lib/automysqlbackup $PROTO://$FTP_USER@$FTP_HOST/main/automysqlbackup >> $SESSIONLOG 2>&1  || ERRSTAT=1
            duplicity remove-all-but-n-full 5 --force $dry $PROTO://$FTP_USER@$FTP_HOST/main/automysqlbackup >> $SESSIONLOG 2>&1  || ERRSTAT=1
+           duplicity cleanup --extra-clean --force $dry $PROTO://$FTP_USER@$FTP_HOST/main/automysqlbackup >> $SESSIONLOG 2>&1 || ERRSTAT=1
     else
        echo "WARNING: It seems that the last mysql backup is still runing" >> $SESSIONLOG
        echo "Skipping mysql backup - please re-schedule" >> $SESSIONLOG