PHP CLI in Cron prüfen
This commit is contained in:
@@ -9,27 +9,23 @@ $doNotCheckForAuthentification = true;
|
||||
$folder = CRON_PATH;
|
||||
$fileArray = array();
|
||||
|
||||
foreach (@scandir($folder) as $file)
|
||||
{
|
||||
if ($file[0] != '.')
|
||||
{
|
||||
foreach (@scandir($folder) as $file) {
|
||||
if ($file[0] != '.') {
|
||||
if (is_file($folder . '/' . $file) && $file != 'init.php')
|
||||
$fileArray[] = $file;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($fileArray as $file)
|
||||
{
|
||||
foreach ($fileArray as $file) {
|
||||
$timeOfFile = str_replace('-', '', substr($file, 0, 2));
|
||||
$rest = date('i', time()) % $timeOfFile;
|
||||
|
||||
if (is_numeric($rest) && $rest == 0)
|
||||
{
|
||||
if (is_numeric($rest) && $rest == 0) {
|
||||
exec('/usr/bin/php -f "' . CRON_PATH . $file . '"');
|
||||
set_time_limit(30);
|
||||
usleep(500000);
|
||||
}
|
||||
}
|
||||
|
||||
if (trim(exec('dpkg -s php7.4-cli | grep Status: ')) != '' || trim(exec('dpkg -s php7.3-cli | grep Status: ')) != '' || trim(exec('dpkg -s php8.0-cli | grep Status: ')) != '' || trim(exec('dpkg -s php8.1-cli | grep Status: ')) != '' || trim(exec('dpkg -s php8.2-cli | grep Status: ')) != '')
|
||||
if (trim(exec('dpkg -s php-cli | grep Status: ')) != '')
|
||||
setConfig('cron:execution.cron', time());
|
||||
|
||||
Reference in New Issue
Block a user