#!/usr/bin/perl use strict; my %files; # load %files with names of all images on disk for my $disk (qw/F G H/) { if ( open( I, $disk."dir.txt" )) { while () { next unless ( /_/ ); my $name = "$disk:\\backup\\" . ( split )[4]; $files{$name} = undef; } } else { warn "unable to open dir.txt for $disk: -- $!\n"; next; } } # eliminate hash elements in %files if Netbackup thinks they are on disk if ( open( I, "cat.txt" )) { while () { if ( /([FGH]:\\backup\\)/ ) { my $path = $1; s/\Q$path\E/*/g; my $name = $path . ( split /\*/ )[1]; delete $files{$name}; } } } else { # best to stop here if that last open failed: die "open failed for cat.txt: $!"; } # delete files that are left in the hash unlink for ( keys %files );