in reply to in Perl find call looking to exclude folder and ignore duplicate finds.
See File::Find on $File::Find::prune. I think in your situation, you want to do something like:
... if( $File::Find::name eq '/data/logs/master' ) { $File::Find::prune = 1; # stop searching through this } elsif( -f $File::Find::name && $File::Find::name =~ /auth.log$/ +) { save_file($File::Find::name) } else { # ignore the file } ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: in Perl find call looking to exclude folder and ignore duplicate finds.
by ss_ham (Initiate) on Apr 19, 2023 at 10:10 UTC | |
by Tux (Canon) on Apr 19, 2023 at 10:30 UTC | |
by Corion (Patriarch) on Apr 19, 2023 at 10:42 UTC |