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

20040505: modificatoins to LDM scour script



>From: "Karen Cooper" <address@hidden>
>Organization: NOAA/National Severe Storms Laboratory
>Keywords:  200405051451.i45Ep0tK004901 IDD CRAFT hardware

Karen, Robert, et. al.,

>FYI: regarding the scour script.
>
>On linux a simple modification to the scour script can allow you to 
>remove files on the order of minutes (instead of the default days).   It 
>also works on Solaris if you install gfind and use it as opposed to the 
>Solaris find command.
>
>The change is:
>
>original:
>  find . -type f -mtime +$FINDAGE -name "$pattern" -exec rm -f {} \;) \
> 
>new:
>  find . -type f -mmin +$FINDAGE -name "$pattern" -exec rm -f {} \;) \
>
>The just modify your scour settings to be minutes not days.
>
>This has worked very well on many of my systems where I ony keep 1-4 
>hours of data at a time.

A different change you can make to ~ldm/bin/scour makes it much more
efficient and is supported on all platforms:

change:

                 find . -type f -mtime +$FINDAGE -name "$pattern" \
                     -exec rm -f {} \;) && touch "$edir/.scour$pattern"

to:
                 find . -type f -mtime +$FINDAGE -name "$pattern" \
                     -print | xargs rm -f ) && touch "$edir/.scour$pattern"

Here a list of files to be deleted will be passed to 'xargs' which will run
'rm -f'.  'xargs' will break up the command line into as many pieces
it needs to do all of the scouring.  The original scour code execs
'rm -f' for each file that is to be deleted.

The modified 'scour' can be found in the pub/ldm/scour directory
of anonymous FTP on our FTP server, ftp.unidata.ucar.edu.

The modification listed above will be included in future LDM releases
(it is not in ldm-6.0.14 or ldm-6.0.15).

>address@hidden
>Phone:405-366-0434     
>Cell:405-834-8559
>SAIC/Systems Analyst
>National Severe Storms Laboratory

Cheers,

Tom
--
NOTE: All email exchanges with Unidata User Support are recorded in the
Unidata inquiry tracking system and then made publically available
through the web.  If you do not want to have your interactions made
available in this way, you must let us know in each email you send to us.