+ print curr_time, " check $host $num\n";
+
+ my $sth = $dbh->prepare(qq{
+ SELECT count(*)
+ FROM files
+ JOIN shares on shares.id = shareid
+ JOIN hosts on hosts.id = shares.hostid
+ WHERE hosts.name = ? and backupnum = ?
+ });
+ $sth->execute($host, $num);
+ my ($files) = $sth->fetchrow_array;
+
+ if ( $files == 0 ) {
+ warn "EMPTY INCREMENT, cleanup ",dump( @tar_parts );
+ foreach my $path ( @tar_parts ) {
+ my $full = "$Conf{ArchiveDest}/$path";
+ warn "rm $full\n";
+ unlink $full || die "can't remove $full: $!";
+ }
+ return;
+ }