- push(@HostList, $host);
- $num ||= $backups[$#backups]{num};
- push(@BackupList, $num);
+
+ $sth->execute( $host );
+ if ( $sth->rows == 0 ) {
+ warn "no backups to archive on $host\n";
+ next;
+ }
+
+ while ( my $row = $sth->fetchrow_hashref ) {
+ warn "+ ", $row->{host}, " ", $row->{num}, "\n";
+ push(@HostList, $host);
+ push(@BackupList, $row->{num});
+ }