I have multiple PHP-FPM chroot sites that need to run the sessionclean cronjob. I found this gist here:
https://gist.github.com/zerthimon/4e15f4d04c888dee0410
Which has this edit of the /etc/cron.d/php file
*/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) \;
First to note is that I am running php7, so php5 becomes php. Second note is that I have no maxlifetime in /usr/lib/php so am trying to run this without. Here is my modification which is not working:
[ -x /usr/lib/php/sessionclean ] && [ -d /var/www/html ] && find /var/www/html -path "*/var/lib/php" -exec /usr/lib/php/sessionclean {} \;
Can someone please tell me how to modify the above to parse through each /var/www/html/[chroot]/var/lib/php/sessions directory to remove sessionfiles that are not currently being used?
Thank You.