From d0d29e39059d083b3d3fcf4402e96f7ff51522b6 Mon Sep 17 00:00:00 2001 From: dpavlin Date: Thu, 13 Oct 2005 15:09:55 +0000 Subject: [PATCH] r8497@llin: dpavlin | 2005-10-13 17:09:51 +0200 re-create tar increments if size differs or if tar file dissapared git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/BackupPC/trunk@192 8392b6e1-25fa-0310-8288-cc32f8e212ea --- bin/BackupPC_incPartsUpdate | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bin/BackupPC_incPartsUpdate b/bin/BackupPC_incPartsUpdate index 3f84fff..6d3d200 100755 --- a/bin/BackupPC_incPartsUpdate +++ b/bin/BackupPC_incPartsUpdate @@ -63,12 +63,13 @@ select backups.id as backup_id, hosts.name as host, shares.name as share, - backups.num as num + backups.num as num, + inc_size from backups join shares on backups.hostid = shares.hostid and shares.id = backups.shareid join hosts on shares.hostid = hosts.id -where inc_size < 0 and not inc_deleted +where not inc_deleted order by backups.date } ); @@ -82,6 +83,12 @@ my $sth_inc_deleted = $dbh->prepare(qq{ update backups set inc_deleted = ? where while (my $row = $sth->fetchrow_hashref) { my $tar_file = BackupPC::SearchLib::getGzipName($row->{'host'}, $row->{'share'}, $row->{'num'}); + + my $size = -1; + $size = (stat( "$tar_dir/$tar_file" ))[7] if (-e "$tar_dir/$tar_file"); + + next if ($row->{'inc_size'} != -1 && $size != -1 && $row->{'inc_size'} == $size); + print curr_time, " ", $row->{'host'}, ":", $row->{'share'}, " #", $row->{'num'}, " -> $tar_file"; my $t = time(); -- 2.20.1