Skip to content

Instantly share code, notes, and snippets.

@zerthimon
Created May 17, 2015 10:23
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zerthimon/4e15f4d04c888dee0410 to your computer and use it in GitHub Desktop.
Save zerthimon/4e15f4d04c888dee0410 to your computer and use it in GitHub Desktop.
php5 session cleanup (crontab) in chrooted pools (of php-fpm)
# Look for and purge old sessions every 30 minutes
*/30 * * * * root [ -x /usr/lib/php5/maxlifetime ] && [ -x /usr/lib/php5/sessionclean ] && [ -d /var/www/pools ] && find /var/www/pools -path "*/var/lib/php5" -exec /usr/lib/php5/sessionclean {} $(/usr/lib/php5/maxlifetime) \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment