uawdijnntqw1x1x1
IP : 52.14.25.155
Hostname : axolotl
Kernel : Linux axolotl 4.9.0-13-amd64 #1 SMP Debian 4.9.228-1 (2020-07-05) x86_64
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
OS : Linux
PATH:
/
var
/
www
/
axolotl
/
data
/
www
/
yar.axolotls.ru
/
bitrix
/
modules
/
main
/
tools
/
clear_old_cache.php
/
/
<? define("STOP_STATISTICS", true); define("NOT_CHECK_PERMISSIONS", true); set_time_limit(1800); define("LANG", "ru"); $strLOG_FILE = $_SERVER["DOCUMENT_ROOT"]."/upload/clear_cache_files.log"; require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php"); $dLog = fopen($strLOG_FILE, "wb"); fwrite($dLog, date("r")."\n"); fwrite($dLog, mktime()."\n"); $iGoodNum = 0; $iOldNum = 0; $iEmptyDirNum = 0; function CheckCacheFiles_Rec($strDir) { global $iGoodNum, $iOldNum, $iEmptyDirNum, $dLog; if ($handle = @opendir($strDir)) { while (($file = readdir($handle)) !== false) { if ($file == "." || $file == "..") continue; if (is_dir($strDir."/".$file)) { CheckCacheFiles_Rec($strDir."/".$file); } elseif (is_file($strDir."/".$file)) { $ext = ""; $ext_pos = bxstrrpos($file, "."); if ($ext_pos!==false) $ext = substr($file, $ext_pos + 1); $bCacheExp = False; if ($ext=="html") $bCacheExp = CPageCache::IsCacheExpired($strDir."/".$file); elseif ($ext=="php") $bCacheExp = CPHPCache::IsCacheExpired($strDir."/".$file); if ($bCacheExp) { $iOldNum++; @unlink($strDir."/".$file); } else { $iGoodNum++; } } } @closedir($handle); } clearstatcache(); $bEmptyFolder = True; if ($handle = @opendir($strDir)) { while (($file = readdir($handle)) !== false) { if ($file == "." || $file == "..") continue; $bEmptyFolder = False; break; } } if ($bEmptyFolder) { $iEmptyDirNum++; @rmdir($strDir); } } list($usec, $sec) = explode(" ", microtime()); $start_time = ((float)$usec + (float)$sec); CheckCacheFiles_Rec($_SERVER["DOCUMENT_ROOT"]."/bitrix/cache"); list($usec, $sec) = explode(" ", microtime()); $end_time = ((float)$usec + (float)$sec); fwrite($dLog, "\nTime - ".round($end_time-$start_time, 3)." sec\n"); fwrite($dLog, "\nFiles deleted - ".$iOldNum."\n"); fwrite($dLog, "Empty folders removed - ".$iEmptyDirNum."\n"); fwrite($dLog, "\nFiles up to date - ".$iGoodNum."\n"); fwrite($dLog, "\nDone\n"); fclose($dLog); require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/epilog_after.php"); ?>
/var/www/axolotl/data/www/yar.axolotls.ru/bitrix/modules/main/tools/clear_old_cache.php