pm -> pod
[BackupPC.git] / bin / BackupPC_tarIncCreate
index 52f3618..fe77418 100755 (executable)
@@ -252,7 +252,7 @@ sub new_tar_part {
        if ($fh) {
                return if ($current_tar_size == 0);
 
-               print STDERR " $part";
+               print STDERR "\n\t+ $part:";
 
                #
                # Finish with two null 512 byte headers,
@@ -271,6 +271,8 @@ sub new_tar_part {
 
                my $size = (stat( $file . '.tar.gz' ))[7] || die "can't stat ${file}.tar.gz";
 
+               print "$file, $size bytes, $items_in_part items";
+
                $sth_backup_parts->execute(
                        $backup_id,
                        $part,
@@ -298,6 +300,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(
@@ -306,7 +314,7 @@ sub new_tar_part {
                                $backup_id
                        );
 
-                       print STDERR ", $total_increment_size bytes\n" if ($opts{v});
+                       print "\n\ttotal $total_increment_size bytes";
 
                        return;
                }