my $LOGSIZE = `du -s $LOGSTR | /bin/awk '{print \$1}'`; chomp( $LOGSTR ); my $I = 5; my $S; # Up to 10G while ( $LOGSIZE > 10000000 && $I >= -1 ) { if ( $I <= -1 ) { $S = ""; } else { $S = "+"; } my $LOGSIZE = `du -s $LOGSTR | /bin/awk '{print \$1}'`; chomp( $LOGSTR ); `/usr/bin/find $LOGSTR -name "*.gz" -print -mtime $S$I -exec rm \{\} \\\;`; sleep 2; $I--; } ---