NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.
To learn about what's going on, see About the Archive Site.
>From: address@hidden >Organization: . >Keywords: 199902232256.PAA14451 > >Is there a way to set scouring to less than 24 hours? > >I'd love to be able to discard some of the HRS stuff long before >it is a day old. > >Bill > > > ________________________________ > >William T. Corcoran Southwest Missouri State University >address@hidden Springfield, Missouri 65804 >(417) 836-5781 Department of Geography > http://cirrus.smsu.edu for my view of the weather > Bill, I use the following script to scour by a number of files, rather than by day: <<<<<<<<<<<<<<<<<<<< scour_bynumber.csh >>>>>>>>>>>>>>>>>>>>>>>>>> #!/bin/csh -f if($#argv < 2) then echo 'Usage: scour_bynumber.csh directory pattern [number]' exit endif if($#argv == 3) then set KEEP=$3 else set KEEP=1 endif cd $1 set FILES=`ls -r *${2}*` if($#FILES > $KEEP) then echo SCOUR $2 @ COUNT = $KEEP + 1 while ($COUNT <= $#FILES) echo " scour $FILES[${COUNT}]" rm -f $FILES[${COUNT}] @ COUNT = $COUNT + 1 end endif ********************************************************************** I use the above script for scouring things like RUC data, where I only want to keep the last 1 or 2 runs, instead of 8 per day (leads to 15 files in a directory at 1 time if using scour). I invoke the above script like: scour_bynumber.csh ~ldm/data/gempak/hds ruc2 2 The result of the above is to scour all files in the ~ldm/data/gempak/hds data directory that have "ruc2" in their name down to 2 files (the last complete file plus the one currently getting data). Steve Chiswell