From 09ea59634d10f59a731a411a3cd8e0d6b2d6cd59 Mon Sep 17 00:00:00 2001 From: iklaric Date: Mon, 7 May 2007 13:20:38 +0000 Subject: [PATCH] - new version of burnArchive that should work both on QC and on AGI git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/BackupPC/trunk@373 8392b6e1-25fa-0310-8288-cc32f8e212ea --- bin/BackupPC_burnArchiveCLI | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/bin/BackupPC_burnArchiveCLI b/bin/BackupPC_burnArchiveCLI index 31b6209..d4fc321 100755 --- a/bin/BackupPC_burnArchiveCLI +++ b/bin/BackupPC_burnArchiveCLI @@ -481,15 +481,22 @@ foreach my $copy_nr ( 1 .. $copies ) { my $host = $p->{host}; my $share = $p->{share}; my $dump = $p->{num}; - my $otherUser = "backuppc-agi"; - - 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"; + 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"); -- 2.20.1