From 2e54d2a77d315e1c0fcd513287d6ea67b5b8d811 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Wed, 26 Jan 2011 16:56:48 +0000 Subject: [PATCH 1/1] select backup number for each host --- bin/BackupPC_archiveStart | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/BackupPC_archiveStart b/bin/BackupPC_archiveStart index 8f39e06..c527fa4 100755 --- a/bin/BackupPC_archiveStart +++ b/bin/BackupPC_archiveStart @@ -54,7 +54,7 @@ my %opts; # no options currently if ( !getopts("", \%opts) || @ARGV < 3 ) { print STDERR <ConfigRead($ArchiveHost); my(@HostList, @BackupList); for ( my $i = 2 ; $i < @ARGV ; $i++ ) { - my $host = $ARGV[$i]; + my ($host,$num) = split(/:/,$ARGV[$i],2); if ( !defined($Hosts->{$host}) ) { print(STDERR "$0: host $host doesn't exist... quitting\n"); exit(1); @@ -83,7 +83,8 @@ for ( my $i = 2 ; $i < @ARGV ; $i++ ) { exit(1); } push(@HostList, $host); - push(@BackupList, $backups[$#backups]{num}); + $num ||= $backups[$#backups]{num}; + push(@BackupList, $num); } my $ReqFileName; -- 2.20.1