Verweiste/Unvollständige Duply Backups löschen

Manchmal zeigt duply list folgende Ausgabe:

-------------------------
Chain start time: Mon Mar  2 04:00:02 2015
Chain end time: Sat Mar  7 04:00:02 2015
Number of contained backup sets: 6
Total number of contained volumes: 199
 Type of backup set:                            Time:      Num volumes:
                Full         Mon Mar  2 04:00:02 2015               194
         Incremental         Tue Mar  3 04:00:02 2015                 1
         Incremental         Wed Mar  4 04:00:02 2015                 1
         Incremental         Thu Mar  5 04:00:02 2015                 1
         Incremental         Fri Mar  6 04:00:03 2015                 1
         Incremental         Sat Mar  7 04:00:02 2015                 1
-------------------------
Also found 0 backup sets not part of any chain,
and 2 incomplete backup sets.
These may be deleted by running duplicity with the "cleanup" command.
--- Finished state OK at 02:00:56.586 - Runtime 00:00:01.884 ---

Dies sagt uns unter anderem dass es zwei Backups gibt die unvollständig oder veraltet sind. Zuerst einmal ist es interessant zu sehen welche Kommandos Duply überhaupt benutzt um an die unvollständigen Dumps zu kommen/sie zu löschen(duply cleanup --dryrun):

Start duply v1.9.1, time is 2015-03-08 02:04:28.
Using profile '/root/.duply/backup'.
Using installed duplicity version 0.6.24, python 2.7.9, gpg 1.4.18 (Home: ~/.gnupg), awk 'GNU Awk 4.1.1, API: 1.1 (GNU MPFR 3.1.2-p3, GNU MP 6.0.0)', bash '4.3.30(1)-release (x86_64-pc-linux-gnu)'.
Autoset found secret key of first GPG_KEY entry '*' for signing.
-- Run cmd -- Checking TEMP_DIR '/tmp' is a folder --
test -d /tmp 2>&1
-- Run cmd -- Checking TEMP_DIR '/tmp' is writable --
test -w /tmp 2>&1
TODO: reimplent tmp space check
-- Run cmd -- Test - Encrypt to '*' & Sign with '*' --
echo * | /usr/bin/gpg --sign --default-key * --passphrase-fd 0 --batch -r * --status-fd 1 -o /tmp/duply.2427.1425776669_ENC -e /usr/bin/duply 2>&1
-- Run cmd -- Test - Decrypt --
echo * | /usr/bin/gpg --passphrase-fd 0 --batch -o /tmp/duply.2427.1425776669_DEC -d /tmp/duply.2427.1425776669_ENC 2>&1
-- Run cmd -- Test - Compare --
test "$(cat '/usr/bin/duply')" = "$(cat '/tmp/duply.2427.1425776669_DEC')" 2>&1
Cleanup - Delete '/tmp/duply.2427.1425776669_*'(FAILED)

--- Start running command CLEANUP at 02:04:29.439 ---
TMPDIR='/tmp' PASSPHRASE=* FTP_PASSWORD=* duplicity cleanup --name duply_backup --encrypt-key * --sign-key * --verbosity '4' --full-if-older-than 1W --volsize 512 --asynchronous-upload 'ftp://user@*.de:21//webserver01'
--- Finished state OK at 02:04:29.523 - Runtime 00:00:00.083 ---

Um zu sehen was Duply löschen würde reicht ein einfaches duply cleanup. Schlussendlich können wir die Backups löschen mit dem Kommando duply backup cleanup --force:

Start duply v1.9.1, time is 2015-03-08 02:05:35. 
Using profile '/root/.duply/backup'.             
Using installed duplicity version 0.6.24, python 2.7.9, gpg 1.4.18 (Home: ~/.gnupg), awk 'GNU Awk 4.1.1, API: 1.1 (GNU MPFR 3.1.2-p3, GNU MP 6.0.0)', b
ash '4.3.30(1)-release (x86_64-pc-linux-gnu)'.   
Autoset found secret key of first GPG_KEY entry '*' for signing.
Checking TEMP_DIR '/tmp' is a folder (OK)        
Checking TEMP_DIR '/tmp' is writable (OK)        
TODO: reimplent tmp space check                  
Test - Encrypt to '*' & Sign with '*' (OK)
Test - Decrypt (OK)                              
Test - Compare (OK)                              
Cleanup - Delete '/tmp/duply.3373.1425776736_*'(OK)
                                                 
--- Start running command CLEANUP at 02:05:36.778 ---
NcFTP version is 3.2.5                           
Local and Remote metadata are synchronized, no sync needed.
Warning, found incomplete backup sets, probably left from aborted session
Last full backup date: Mon Mar  2 04:00:02 2015  
Deleting these files from backend:               
duplicity-full.20140512T020004Z.vol1.difftar.gpg 
duplicity-full.20140512T020004Z.vol2.difftar.gpg
.
.
.
duplicity-full.20140602T020005Z.vol99.difftar.gpg
duplicity-full.20140602T020005Z.vol100.difftar.gpg

--- Finished state OK at 02:07:43.568 - Runtime 00:02:06.789 ---
root@webserver01 ~ #
This entry was posted in General, Linux. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.