[php-maint] Bug#631098: PHP Garbage Collection

Martin Meredith mez at debian.org
Mon Jun 20 08:34:32 UTC 2011


Package: php5
Version: 5.3.6-12

I've had a problem where somehow, I've managed to end up with 
approximately 1,000,000 session files on my server.

Due to the large amount of files, the current crontab to clear them was 
unable to deal with it (xargs would fail to take in the HUGE list of files).

It seems that rather than using xargs (even with the limit), that using 
the -exec option of find might be a little bit more sane?


09,39 *     * * *     root   [ -x /usr/lib/php5/maxlifetime ] && [ -d 
/var/lib/php5 ] && find /var/lib/php5/ -type f -cmin 
+$(/usr/lib/php5/maxlifetime) -exec rm {} \;;

Is what I currently have in my cron script to work around this issue.





More information about the pkg-php-maint mailing list