r11653@llin: dpavlin | 2005-12-12 23:11:12 +0100
authordpavlin <dpavlin@8392b6e1-25fa-0310-8288-cc32f8e212ea>
Mon, 12 Dec 2005 21:11:17 +0000 (21:11 +0000)
committerdpavlin <dpavlin@8392b6e1-25fa-0310-8288-cc32f8e212ea>
Mon, 12 Dec 2005 21:11:17 +0000 (21:11 +0000)
 cleanup old single archive increment if it exists

git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/BackupPC/trunk@261 8392b6e1-25fa-0310-8288-cc32f8e212ea

bin/BackupPC_tarIncCreate

index 52f3618..7704eaa 100755 (executable)
@@ -298,6 +298,12 @@ sub new_tar_part {
                        } else {
                                print STDERR " [last]" if ($opts{v});
                                move("${tar_path}", "${tar_path_final}");
+
+                               # if this archive was single part, remove it
+                               foreach my $suffix (qw/.tar.gz .md5/) {
+                                       my $path = $tar_path_final . $suffix;
+                                       unlink $path if (-e $path);
+                               }
                        }
 
                        $sth_inc_size->execute(