5

On my Debian Wheezy, every half-hour a cron job runs:

find /var/lib/php5/ -depth -mindepth 1 -maxdepth 1 -type f -ignore_readdir_race -cmin +$(/usr/lib/php5/maxlifetime) ! -execdir fuser -s {} 2>/dev/null \; -delete)

This deletes oldish PHP state/session files. I would like to drop this cron job altogether, or at least decrease its frequency. In which of the following use-cases is that possible?

  1. A server which has no PHP code running
  2. A server with the odd page with PHP here and there, but nothing serious like a CMS
  3. A server running, say, some PHP CMS, with user sessions, but with not too many page views (say up to 50,000 a month)
3
  • 6
    I think the right question to ask here is "What would I gain by throwing away every assumption the maintainers of this package made just so I can save a line of logging per half hour in syslog"
    – gparent
    Mar 28, 2013 at 18:02
  • 2
    Perhaps it would help us to understand your Question if you explained the actual problem you are having. Server Fault requires that Questions be based on an actual or potential problem you are facing. There doesn't seem to be any meaningful downside to leaving the cron job as the port maintainers had intended.
    – Chris S
    Mar 29, 2013 at 13:44
  • 4
    My $0.02. The PHP session handling built into the Debian package is horribly broken and annoying. I comment out the default jobs in /etc/cron.d/php5 and add specific jobs, or adjust the php.ini settings so that PHP handles garbage collection like what happens on most other systems by default. Or even better, switch your session handler out and make your sessions database or memory based.
    – Zoredache
    Apr 13, 2013 at 0:54

0

Browse other questions tagged .