[Mapserver-users] Deleting old GIF image files

Antti.Roppola at brs.gov.au Antti.Roppola at brs.gov.au
Mon Jun 23 17:36:18 PDT 2003


Or if you want something more demand driven, I added a few lines
to the PHP to delete all but the 10 most recent images.

Unlike a cron job, this will automagically clean up the directory
more often if required.

Antti

-----Original Message-----
From: Krzysztof Chodak [mailto:k.chodak at autoguard.pl]
Sent: Monday, 23 June 2003 6:50 PM
To: MAPSERVER
Subject: Fw: [Mapserver-users] Deleting old GIF image files


I personally use wsh script (Windows):

 <job>
 <script language="JSCript">
 var fso = WScript.CreateObject("Scripting.FileSystemObject"),
  startDate = new Date(),
  folder = fso.GetFolder("D:\\tmp\\"),
  files = new Enumerator(folder.Files),
  file
 while (!files.atEnd())
 {
  file = files.item()
  if ((startDate - new Date(file.DateLastModified)) > 86400000)
  {
   file.Delete()
  }
  files.moveNext()
 }
 </script>
 </job>

 it is saved in CleanUpTemp.wsf file. I use Task Scheduling to run it from
 time to time (currently once per day). Script is launched by following
 command:
 C:\WINNT\system32\cscript.exe CleanUpTemp.wsf

 BR

Krzysztof Chodak

>
> ----- Original Message ----- 
> From: Thomas Jensen
> To: mapserver-users at lists.gis.umn.edu
> Sent: Monday, June 23, 2003 8:58 AM
> Subject: [Mapserver-users] Deleting old GIF image files
>
>
> Hi
>
> I would like to know if anyone can suggest a sollution to my problem. I
have
> used MapServer to generate mapImages on the www.langelandatlas.dk website.
> The problem is, that the ms_temp folder which contains the GIF image files
> rapidly is filled with old image files which are no longer used. Can
> MapServer be set ud to automatically delete the image files it has created
> after they have been used?
>
> Sincerely
>
> Thomas Jensen
> Sven Allan Jensen as
> Sankelmarksgade 9
> DK - 9000 Aalborg
> Ph: 96 31 40 64
> E-mail: tj at svaj.dk
> www.svaj.dk
>

_______________________________________________
Mapserver-users mailing list
Mapserver-users at lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users




More information about the MapServer-users mailing list