434 |
|
|
435 |
$sth->{insert_backups} = $dbh->prepare(qq{ |
$sth->{insert_backups} = $dbh->prepare(qq{ |
436 |
INSERT INTO backups (hostID, num, date, type, shareid, size) |
INSERT INTO backups (hostID, num, date, type, shareid, size) |
437 |
VALUES (?,?,?,?,?,?) |
VALUES (?,?,?,?,?,-1) |
438 |
|
}); |
439 |
|
|
440 |
|
$sth->{update_backups_size} = $dbh->prepare(qq{ |
441 |
|
UPDATE backups SET size = ? |
442 |
|
WHERE hostID = ? and num = ? and date = ? and type =? and shareid = ? |
443 |
}); |
}); |
444 |
|
|
445 |
$sth->{insert_files} = $dbh->prepare(qq{ |
$sth->{insert_files} = $dbh->prepare(qq{ |
505 |
# dump some log |
# dump some log |
506 |
print curr_time," ", $share; |
print curr_time," ", $share; |
507 |
|
|
|
my ($f, $nf, $d, $nd, $size) = recurseDir($bpc, $hostname, $files, $backupNum, $share, "", $shareID); |
|
|
|
|
508 |
$sth->{insert_backups}->execute( |
$sth->{insert_backups}->execute( |
509 |
$hostID, |
$hostID, |
510 |
$backupNum, |
$backupNum, |
511 |
$backup->{'endTime'}, |
$backup->{'endTime'}, |
512 |
substr($backup->{'type'},0,4), |
substr($backup->{'type'},0,4), |
513 |
$shareID, |
$shareID, |
514 |
|
); |
515 |
|
|
516 |
|
my ($f, $nf, $d, $nd, $size) = recurseDir($bpc, $hostname, $files, $backupNum, $share, "", $shareID); |
517 |
|
|
518 |
|
$sth->{update_backups_size}->execute( |
519 |
$size, |
$size, |
520 |
|
$hostID, |
521 |
|
$backupNum, |
522 |
|
$backup->{'endTime'}, |
523 |
|
substr($backup->{'type'},0,4), |
524 |
|
$shareID, |
525 |
); |
); |
526 |
|
|
527 |
print " commit"; |
print " commit"; |
646 |
# daylight saving time change offset for 1h |
# daylight saving time change offset for 1h |
647 |
my $dst_offset = 60 * 60; |
my $dst_offset = 60 * 60; |
648 |
|
|
649 |
my $key_dst1 = join(" ", ( |
my $key_dst_prev = join(" ", ( |
650 |
$shareID, |
$shareID, |
651 |
$dir, |
$dir, |
652 |
$path_key, |
$path_key, |
654 |
$filesInBackup->{$path_key}->{'size'} |
$filesInBackup->{$path_key}->{'size'} |
655 |
)); |
)); |
656 |
|
|
657 |
my $key_dst2 = join(" ", ( |
my $key_dst_next = join(" ", ( |
658 |
$shareID, |
$shareID, |
659 |
$dir, |
$dir, |
660 |
$path_key, |
$path_key, |
665 |
my $found; |
my $found; |
666 |
if ( |
if ( |
667 |
! defined($beenThere->{$key}) && |
! defined($beenThere->{$key}) && |
668 |
! defined($beenThere->{$key_dst1}) && |
! defined($beenThere->{$key_dst_prev}) && |
669 |
! defined($beenThere->{$key_dst2}) && |
! defined($beenThere->{$key_dst_next}) && |
670 |
! ($found = found_in_db($key, @data)) |
! ($found = found_in_db($key, @data)) |
671 |
) { |
) { |
672 |
print STDERR "# key: $key [", $beenThere->{$key},"]" if ($debug >= 2); |
print STDERR "# key: $key [", $beenThere->{$key},"]" if ($debug >= 2); |