php-defaults/debian/php-common.php.cron.d
Daniel Schaal 87f0c9270d Add support for systemd timers for phpsessionclean
* Add systemd timer and service for phpsessionclean
* Add check to run phphsessionclean from cron only
  when not using systemd
2016-12-31 14:51:11 +01:00

15 lines
712 B
D

# /etc/cron.d/php@PHP_VERSION@: crontab fragment for PHP
# This purges session files in session.save_path older than X,
# where X is defined in seconds as the largest value of
# session.gc_maxlifetime from all your SAPI php.ini files
# or 24 minutes if not defined. The script triggers only
# when session.save_handler=files.
#
# WARNING: The scripts tries hard to honour all relevant
# session PHP options, but if you do something unusual
# you have to disable this script and take care of your
# sessions yourself.
# Look for and purge old sessions every 30 minutes
09,39 * * * * root [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi