#!/bin/tcsh # Leave the last two entries. Today's and yesterday's. On Monday, leave # Friday's and Monday's. You can't do that with the find command! rm -f `ls --sort=time --reverse *alerts_binlog.* | head -n -2` rm -f `ls --sort=time --reverse top_list_binlog.* | head -n -2`