Skip to content

Commit 9d9a325

Browse files
author
vogelor
committed
The "new" php session-cleaning source works fine for several days at my servers, so we can delete the old (not working) one
1 parent 695825a commit 9d9a325

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

server/cron_daily.php

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -179,30 +179,14 @@ function setConfigVar( $filename, $varName, $varValue ) {
179179
// Cleanup website tmp directories
180180
#######################################################################################################
181181

182-
/*
183-
$sql = "SELECT domain_id, domain, document_root, system_user FROM web_domain WHERE server_id = ".$conf["server_id"];
184-
$records = $app->db->queryAllRecords($sql);
185-
$app->uses('system');
186-
if(is_array($records)) {
187-
foreach($records as $rec){
188-
$tmp_path = realpath(escapeshellcmd($rec["document_root"].'/tmp'));
189-
if($tmp_path != '' && strlen($tmp_path) > 10 && is_dir($tmp_path) && $app->system->is_user($rec['system_user'])){
190-
exec("cd ".$tmp_path."; find -ctime +1 -user ".escapeshellcmd($rec['system_user'])." | grep -v -w .no_delete | xargs rm &> /dev/null 2> /dev/null");
191-
if($app->system->is_user('www-data')) exec("cd ".$tmp_path."; find -ctime +1 -user www-data | grep -v -w .no_delete | xargs rm &> /dev/null 2> /dev/null");
192-
if($app->system->is_user('wwwrun')) exec("cd ".$tmp_path."; find -ctime +1 -user wwwrun | grep -v -w .no_delete | xargs rm &> /dev/null 2> /dev/null");
193-
}
194-
}
195-
}
196-
*/
197-
198182
$sql = "SELECT domain_id, domain, document_root, system_user FROM web_domain WHERE server_id = ".$conf["server_id"];
199183
$records = $app->db->queryAllRecords($sql);
200184
$app->uses('system');
201185
if(is_array($records)) {
202186
foreach($records as $rec){
203187
$tmp_path = realpath(escapeshellcmd($rec["document_root"].'/tmp'));
204188
if($tmp_path != '' && strlen($tmp_path) > 10 && is_dir($tmp_path) && $app->system->is_user($rec['system_user'])){
205-
exec("cd ".$tmp_path."; find -mtime +2 -name 'sess_*' | grep -v -w .no_delete | xargs rm &> /dev/null 2> /dev/null");
189+
exec("cd ".$tmp_path."; find -mtime +1 -name 'sess_*' | grep -v -w .no_delete | xargs rm &> /dev/null 2> /dev/null");
206190
}
207191
}
208192
}

0 commit comments

Comments
 (0)