in reply to Are there canned fileserver grooming scripts?
Hope this helps :)#!/usr/bin/perl -w use strict; my( $max_size , $min_size ); #parse args for(@ARGV) { if( /^--max_size=(.*)/ ) { $max_size = int( $1 ) } if( /^--min_size=(.*)/ ) { $min_size = int( $1 ) } } # end prints with \n $\ = "\n"; # open curent directory opendir( DIR , "." ); # test directories one by one. while( $_ = readdir( DIR ) ) { # drop "." and ".." next if /^\.\.?$/; # test for max length next if( $max_size and -s $_ > $max_size ); # test for min length next if( $min_size and -s $_ < $min_size ); print } # close... closedir( DIR );
|
|---|