378 |
hosts.name as host, |
hosts.name as host, |
379 |
shares.name as share, |
shares.name as share, |
380 |
backups.num as num, |
backups.num as num, |
381 |
|
backups.date, |
382 |
inc_size, |
inc_size, |
383 |
parts |
parts, |
384 |
|
count(backup_parts.backup_id) as backup_parts |
385 |
from backups |
from backups |
386 |
join shares on backups.hostid = shares.hostid |
join shares on backups.hostid = shares.hostid |
387 |
and shares.id = backups.shareid |
and shares.id = backups.shareid |
388 |
join hosts on shares.hostid = hosts.id |
join hosts on shares.hostid = hosts.id |
389 |
|
full outer join backup_parts on backups.id = backup_parts.backup_id |
390 |
where not inc_deleted |
where not inc_deleted |
391 |
|
group by backups.id, hosts.name, shares.name, backups.num, backups.date, inc_size, parts, backup_parts.backup_id |
392 |
order by backups.date |
order by backups.date |
393 |
|
|
394 |
} ); |
} ); |
417 |
|
|
418 |
print "# size: $size backup.size: ", $row->{inc_size},"\n" if ($opt{d}); |
print "# size: $size backup.size: ", $row->{inc_size},"\n" if ($opt{d}); |
419 |
|
|
420 |
if ( $row->{'inc_size'} != -1 && $size != -1 && $row->{'inc_size'} >= $size) { |
if ( $row->{'inc_size'} != -1 && $size != -1 && $row->{'inc_size'} >= $size && $row->{parts} == $row->{backup_parts}) { |
421 |
if ($check) { |
if ($check) { |
422 |
tar_check($row->{'host'}, $row->{'share'}, $row->{'num'}, $tar_file) && next; |
tar_check($row->{'host'}, $row->{'share'}, $row->{'num'}, $tar_file) && next; |
423 |
} else { |
} else { |
425 |
} |
} |
426 |
} |
} |
427 |
|
|
428 |
print curr_time, " creating $curr_backup/$num_backups ", $row->{'host'}, ":", $row->{'share'}, " #", $row->{'num'}, " -> $tar_file"; |
print curr_time, " creating $curr_backup/$num_backups ", $row->{host}, ":", $row->{share}, " #", $row->{num}, |
429 |
|
" ", strftime('%Y-%m-%d', localtime($row->{date})), " -> $tar_file"; |
430 |
|
|
431 |
my $t = time(); |
my $t = time(); |
432 |
|
|