Since I’m not running a PHP version provided by my distribution I’m responsible for cleaning up old session files myself. Aside from PHP another Perl webapp I run also doesn’t clean up its own session files. Luckily cleaning up these old files is something that’s very easy to do under Linux.
find /tmp/sess_* -mtime +2 -exec rm {} \;
In this example I’m only taking files that are at least 2 days old. Add this to your crontab and your session directory should stay nice and tidy.




Htbaa Reply:
February 16th, 2013 at 18:04
I use Ubuntu, which doesn’t seem to provide this tool. Tmpwatch seems like a nice alternative, thanks for suggesting it.
[Reply]