how about a cron job: <br>
0 1 * * * /path/to/script<br>
<br>
that runs a shell script:<br>
rm -f /path/to/tmp/files/*;<br>
<br><br><div><span class="gmail_quote">On 6/16/06, <b class="gmail_sendername">Doyon, Jean-Francois</b> &lt;<a href="mailto:Jean-Francois.Doyon@ccrs.nrcan.gc.ca" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
Jean-Francois.Doyon@ccrs.nrcan.gc.ca</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Good idea.<br><br>Here's mine, written in Python.&nbsp;&nbsp;It preserves the legend symbology but<br>

deletes other temporary images generated by mapserver:<br><br>#!/home/atlas/web/bin/python<br><br># Directory where MapServer temporary files are created<br><br>TMPDIR = '/dev/shm/atlas'<br><br># Time-To-Live (TTL) in minutes
<br><br>TTL = 5<br><br># Nothing to change below<br><br>from glob import glob<br>from os.path import getatime<br>from os import unlink<br>from time import time<br>import re<br><br>filelist = glob(TMPDIR + '/*.gif') + glob(TMPDIR + '/*.img.tmp')
<br>grace = TTL * 60<br><br>for file in filelist:<br>&nbsp;&nbsp;&nbsp;&nbsp;try:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;atime = getatime(file)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if atime &lt; time() - grace and not<br>re.match('^.*?_\d{5,6}_\d{10}_\d{1,2}_\d{1,2}_\d{1,2}_\d{1,2}\.gif$', file):
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unlink(file)<br>&nbsp;&nbsp;&nbsp;&nbsp;except:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pass<br><br>Cheers,<br>J.F.<br><br>-----Original Message-----<br>From: UMN MapServer Users List [mailto:<a href="mailto:MAPSERVER-USERS@LISTS.UMN.EDU" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
MAPSERVER-USERS@LISTS.UMN.EDU
</a>] On<br>Behalf Of Bruce Raup<br>Sent: June 16, 2006 4:52 PM<br>To: <a href="mailto:MAPSERVER-USERS@LISTS.UMN.EDU" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">MAPSERVER-USERS@LISTS.UMN.EDU</a>
<br>Subject: [UMN_MAPSERVER-USERS] script for dealing with temporary files
<br><br>I see in the mapserver documentation that a suggested way for removing<br>temporary files that mapserver creates is a simple 'find' command:<br><br>#!/bin/csh<br>find /usr/local/www/docs/tmp -follow -name &quot;*.gif&quot; -exec rm {} \;
<br><br>A problem with this is that it even removes files that have just been<br>created.&nbsp;&nbsp;The -mtime option to find is a bit of help if you can wait a day<br>to delete files, but we didn't have that option.&nbsp;&nbsp;So I wrote a simple script
<br>in perl that allows you to specify a minimum age in minutes a file should<br>have before it gets deleted.&nbsp;&nbsp;I'm sure many other people have written such<br>scripts, probably better ones than mine, but I thought I share mine since
<br>it's definitely better than the above 'find' command.&nbsp;&nbsp;It's available at<br><a href="http://cires.colorado.edu/%7Ebraup/software/clean_tmp_area.pl" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://cires.colorado.edu/~braup/software/clean_tmp_area.pl</a><br><br>
If you have any comments or suggestions for improvement, I'd be happy to<br>hear about them.<br><br>Cheers,<br>Bruce<br><br>--<br>Bruce Raup<br><a href="http://cires.colorado.edu/%7Ebraup/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://cires.colorado.edu/~braup/
</a><br></blockquote></div><br>