function init(){ $sock=new sockets(); $ArticaMaxLogsSize=$sock->GET_PERFS("ArticaMaxLogsSize"); if($ArticaMaxLogsSize<1){$ArticaMaxLogsSize=500;} $ArticaMaxLogsSize=$ArticaMaxLogsSize*1000; $GLOBALS["ArticaMaxLogsSize"]=$ArticaMaxLogsSize; $GLOBALS["logs_cleaning"]=$sock->GET_NOTIFS("logs_cleaning"); $GLOBALS["MaxTempLogFilesDay"]=$sock->GET_INFO("MaxTempLogFilesDay"); if($GLOBALS["MaxTempLogFilesDay"]==null){$GLOBALS["MaxTempLogFilesDay"]=5;} }
CleanMysqlDatabase(true); die; } if ($argv[1] == "--squid") { check_all_squid(); die; } if ($argv[1] == "--convert") { die; } if ($argv[1] == "--test-nas") { tests_nas(true); die; } $sock = new sockets(); $ArticaMaxLogsSize = $sock->GET_PERFS("ArticaMaxLogsSize"); if ($ArticaMaxLogsSize < 1) { $ArticaMaxLogsSize = 300; } $GLOBALS["ArticaMaxLogsSize"] = $ArticaMaxLogsSize; $unix = new unix(); $logrotate = $unix->find_program("logrotate"); if (!is_file($logrotate)) { echo "logrotate no such file\n"; } $pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . ".pid"; $timefile = "/etc/artica-postfix/pids/logrotate.time"; $pid = file_get_contents("{$pidfile}"); if ($unix->process_exists($pid, basename(__FILE__))) { $timeMin = $unix->PROCCESS_TIME_MIN($pid); system_admin_events("Already executed PID {$pid} since {$timeMin} Minutes", __FUNCTION__, __FILE__, __LINE__, "logrotate");