[GRASSLIST:373] Re: clearing out .tmp directory?

Jack Varga jvarga at boulder.net
Thu Jun 12 17:38:47 EDT 2003


One way would be to set up a cron task to clear it out at reguraly scheduled 
intervals. This example would do it every hour on the hour between 7:00 am 
and 6:00 pm (system clock time) Monday through Friday.

0 7-18 * 1-5  /usr/bin/find ${HOME}/.tmp -mtime +1 -exec rm -f {} \; 2&>1

The '-mtime +1' is looking for files whose modification time is more than 
one day old.  You can reduce this to fractions of a day by using decimal 
notation (see 'find' manpage).  The 2&>1 redirects stderr to stdout which 
means the owner of the cron (your user id most likely) won't get unnecessary 
mail if find doesn't actually find anything.

If you want, run the command...

find ${HOME/.tmp -mtime +0.2 -exec ls -l {} \;

...to see how it would work.

-jv

On Thu, 12 Jun 2003, Alex Thorn wrote:

> Is there a command (preferably in GRASS 4.3, but GRASS
> 5.0 would work too) to clean out the .tmp directory
> for a location?  I'm running a simulation model that
> fills the .tmp directory regularly, tending to make
> the model run more slowly over time.  Would be cool if
> I could avoid this slowdown.
> 
> Thanks,
> Alex
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
> http://calendar.yahoo.com
> 




More information about the grass-user mailing list