- my ($host,$num) = split(/:/,$_,2);
- if ( !defined($Hosts->{$host}) ) {
- print(STDERR "$0: host $host doesn't exist... quitting\n");
- exit(1);
- }
- my @backups = $bpc->BackupInfoRead($host);
- if ( !@backups ) {
- warn "$0: host $host doesn't have any backups... skipping\n";
- next;
- }
-
- $sth->execute( $host );
- if ( $sth->rows == 0 ) {
- warn "no backups to archive on $host\n";
- push @HostList, $host;
- push @BackupList, 0; # fake, but will make full-text update
- }
-
- while ( my $row = $sth->fetchrow_hashref ) {
- warn "+ ", $row->{host}, " ", $row->{num}, "\n";
- push(@HostList, $host);
- push(@BackupList, $row->{num});
- }
+ my ($host,$num) = split(/:/,$_,2);
+ if ( !defined($Hosts->{$host}) ) {
+ print(STDERR "$0: host $host doesn't exist... quitting\n");
+ exit(1);
+ }
+ if ( defined $num ) {
+ warn "+ $host $num\n";
+ push(@HostList, $host);
+ push(@BackupList, $num);
+ } else {
+ foreach my $num ( @{ $host_nums->{$host} } ) {
+ warn "+ $host $num\n";
+ push(@HostList, $host);
+ push(@BackupList, $num);
+ }
+ }