@@ -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 ' );
201185if (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