[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

19990624: scouring gini




Tom,

the scour script uses the unix "find" command and 1 day is
the smallest increment there.

I use a different script I wrote for Gini, Nexrad and large model
data where I want to keep the last several runs, images etc.

Here is a script that recursively searches through subdirectories
(such as you would use in the nsat/garp configuration) and
keeps the last 20 (defined as KEEP) images.

Store this script in a file called prune_gini.csh.
To use this script, define KEEP as the number of images in each
directory that will be kept. Define "areadir" as the top
level of your gini data (mine has the 1km, 4km, 8km subs underneath,
followed by vis, wv, ir, 3.9 and 12.0 subdirectories etc).
Add the subdirectory where the script will be located to the PATH
definition so that when this script calls itself, it will be found.
Use the chmod command to make the script executable, and your ready to go.

Steve Chiswell
Unidata User Support

#!/bin/csh -f
#
# Script: prune_gini.csh
# Copyright (c)1993 UCAR/Unidata
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose without fee is hereby granted, provided
# that the above copyright notice appear in all copies, that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of UCAR/Unidata not be used in
# advertising or publicity pertaining to distribution of the software
# without specific, written prior permission.  UCAR makes no
# representations about the suitability of this software for any purpose.
# It is provided "as is" without express or implied warranty.  It is
# provided with no support and without obligation on the part of UCAR or
# Unidata, to assist in its use, correction, modification, or enhancement.
#
# Steve Chiswell        4/29/99
#
setenv PATH /usr/local/ldm/util:${PATH}
set KEEP=20
if($#argv == 0) then
   set areadir=/usr/local/ldm/data/gempak/nport
else
   set areadir=$1
endif

############################################################################## 

cd $areadir
@ NUMSUBS=0
#
set DIRS=`ls -d *`
foreach DIR ($DIRS)
   if(-d $DIR) then
      @ NUMSUBS = $NUMSUBS + 1
      prune_gini.csh $DIR
      if($status != 0) rmdir $DIR
   endif
end


@ IRET = 0
# scour down to $KEEP files in this leaf directory
if($NUMSUBS == 0) then
   set FILES=`find . -mtime +0 -print -exec rm -f {} \;`
   #if($#FILES > 0) echo removed old files $FILES
   set FILES=`ls -r`
   if ($#FILES > $KEEP) then
      @ COUNT = $KEEP + 1
      while($COUNT <= $#FILES)
         #echo SCOUR to $FILES[$COUNT]
         rm $FILES[$COUNT]
         @ COUNT = $COUNT + 1
      end
   endif
endif

set FILES=`ls`
if($#FILES == 0) @ IRET = 1


exit(${IRET})



On Fri, 25 Jun 1999, Unidata Support wrote:

> 
> ------- Forwarded Message
> 
> >To: address@hidden
> >From: "Thomas L. Mote" <address@hidden>
> >Subject: scouring question
> >Organization: .
> >Keywords: 199906241759.LAA00744
> 
> 
> Can scour.conf have non-integer days?
> 
> I am now feeding data across from my new NOAAport receiver 
> to my LDM server. I can only access one channel at a time, 
> and I usually have my receiver set to the GOES East 
> channel. I rely on IDD for other products.
> 
> Point is... when running in rapid scan, a lot of imagery 
> comes across. I only wish to save several hours, not an 
> entire day. Some days it has filled my data partition. I 
> will upgrade the LDM server at some point, but not soon 
> enough to solve this problem.
> 
> I have an entry in my scour.conf file that looks like:
> 
> ~ldm/data/goeseast    0.5
> 
> but is only seems to delete files that are at least a day 
> old.
> 
> Thanks.
> 
> Tom
> 
> Thomas L. Mote
> University of Georgia
> 
> 
> 
> 
> 
> ------- End of Forwarded Message
> 
>