- my $rel_path = $tar_file;
-
- if (-d "$tar_dir/$rel_path") {
- mkpath("$stage/$rel_path") unless (-d "$stage/$rel_path");
- $rel_path .= '/' . $p->{part_nr};
- }
- $rel_path .= '.tar.gz';
-
-
- unless (-r "$tar_dir/$rel_path") {
- print "WARNING: can't find increment $rel_path , trying to recreate it using BackupPC_tarIncCreate...\n";
- my $host = $p->{host};
- my $share = $p->{share};
- my $dump = $p->{num};
- my $currUser = getlogin();
- my $otherUser = "";
- if ($currUser eq "agi") {
- $otherUser = "backuppc-agi";
- } elsif ($currUser eq "qc") {
- $otherUser = "backuppc-qc";
- }
- if ($otherUser ne "") {
- my $cmd = "sudo -u $otherUser ".$tarIncCreate. " -h $host -s $share -n $dump";
- print "$cmd ";
- if (system($cmd) != 0) {
- print " FAILED.\n";
- } else {
- print " done.\n";
- }
- }
- }
-
- skip "can't find increment $rel_path, recreateing obviously did not work: $!" unless (-r "$tar_dir/$rel_path");