Commit 1361c426 authored by Paul Cammish's avatar Paul Cammish

Merge branch 'clean-php-sessions_buster' into 'buster-testing'

Clean PHP Sessions (buster)

See merge request !153
parents 0dd2f77d 14d1980d
Pipeline #753 passed with stages
in 36 minutes and 33 seconds
* Added cron to clean up old PHP sessions
sympl-web (10.0.191216.0) stable; urgency=medium
* Added cron to clean up old PHP sessions
-- Paul Cammish <> Mon, 16 Dec 2019 11:45:02 +0000
sympl-web (10.0.190709.0) stable; urgency=medium
* Updated sympl-web-rotate-logs to support new ownership
# Script to clean up old Sympl PHP sessions in /srv/*/php_sessions, based on stock Debian version.
session_config=$(PHP_INI_SCAN_DIR=/etc/php/${version}/${conf_dir}/conf.d/ php${version} -c /etc/php/${version}/${conf_dir}/php.ini -d "error_reporting='~E_ALL'" -r 'foreach(ini_get_all("session") as $k => $v) echo "$k=".$v["local_value"]."\n";')
gc_maxlifetime=$(($(echo "$session_config" | sed -ne 's/^session\.gc_maxlifetime=\(.*\)$/\1/p')/60))
for domain in $( find /srv/ -mindepth 2 -maxdepth 2 -type d -name php_sessions ); do
find -O3 "$domain/" -ignore_readdir_race -depth -mindepth 1 -name 'sess_*' -type f -cmin "+$gc_maxlifetime" -delete
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment