[GRASSLIST:370] clearing out .tmp directory?

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

On Thursday 12 June 2003 16:52, Alex Thorn wrote:

I'm running a simulation model that
fills the .tmp directory regularly, tending to make
the model run more slowly over time.

Are you running a script ? In that case, put something like

   echo -e "Cleaning temporary files"
   rm -f $GISDBASE/$LOCATION_NAME/$MAPSET/.tmp/${HOSTNAME}/*

in an adequate place (just before new iteration, for example). You'd better do
it regularly, if you don't want a "Argument list too long".

If you don't run a script, then force your code to use the "rm shell command"

Please give also a look at "[GRASSLIST:162] RE: Temp files and bunnies" in the
maillist archive

Enjoy
P.

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

On Thursday 12 June 2003 16:52, 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?

H.Bowman <hamish_nospam@yahoo.com> pointed me a nice little prgm available in
your distrb.

/usr/local/grass5/etc/clean_temp

(that you have to put in your path, of course...)