singapore: the smallest big galery
home » forum » General » How can i purge thumbnails in _thumbs have 22500+

You are not logged in.

  • Index
  •  » General
  •  » How can i purge thumbnails in _thumbs have 22500+

#1 2011-04-28 19:42:44

acem77
Member

How can i purge thumbnails in _thumbs have 22500+

Update, a php script i made that will purge the dir set to a timer. I put this in my root of my site and use an option with my ISP account to run it.

<?
$dir = './lakecam/galleries/LakeCamArchive/_thumbs/';

foreach(glob($dir.'*.*') as $v){
 
if( @filemtime($v) < (time()-1800) ) 

unlink($v);

}
?>



Is there a way to purge or limit the amount of thumbnails in that dir?
They are out of control now with 22500+ files and growing in _thumbs.
I guess this happens because each file name is unique for every day and time an image is upload every 2 minutes.

This is my site, itís a lake cam site.
http://www.greatlakesvista.com/lakecam/index.php

I have it archive the last 31 images to let people view the last hour of updates.
This helps people see were the weather was and predict were its going.

Over all Singapore works great as it can take any random pics on my web server and create dynamic
Image gallery.
The names of each file updates per time and date.

Last edited by acem77 (2013-12-09 19:06:30)

Offline

 
  • Index
  •  » General
  •  » How can i purge thumbnails in _thumbs have 22500+