} );
-$sth->execute();
-
my $sth_inc_size = $dbh->prepare(qq{ update backups set inc_size = ?, parts = ? where id = ? });
my $sth_inc_deleted = $dbh->prepare(qq{ update backups set inc_deleted = ? where id = ? });
%BackupPC::SearchLib::Conf = %Conf;
+$sth->execute();
+my $num_backups = $sth->rows;
+my $curr_backup = 1;
+
while (my $row = $sth->fetchrow_hashref) {
my $tar_file = BackupPC::SearchLib::getGzipName($row->{'host'}, $row->{'share'}, $row->{'num'});
# this will return -1 if file doesn't exist
my $size = BackupPC::SearchLib::get_tgz_size_by_name($tar_file);
- print curr_time, " ", $row->{'host'}, ":", $row->{'share'}, " #", $row->{'num'}, " -> $tar_file";
+ print curr_time, " $curr_backup/$num_backups ", $row->{'host'}, ":", $row->{'share'}, " #", $row->{'num'}, " -> $tar_file";
+ $curr_backup++;
my $t = time();
system($cmd) == 0 or die "failed: $?";
- rename "${tar_dir}/${$tar_file}.tmp", "$tar_dir/$tar_file" or die "can't rename $tar_dir/$tar_file: $!";
+ rename("${tar_dir}/${tar_file}.tmp", "$tar_dir/$tar_file") or die "can't rename $tar_dir/$tar_file: $!";
$size = (stat( "$tar_dir/$tar_file" ))[7];
}