Answer the question
In order to leave comments, you need to log in
Why is cron not running but not being processed?
Hello everyone, there is cron, if you go through the browser everything works, but through the crontab the script starts according to the logs, but nothing happens.
<?php
include(__DIR__.'/init.php');
foreach ($config as $index => $row) {
$next_time = strtotime($row['interval']);
$next_time -= $next_time % 60;
$now = time();
$now -= $now % 60;
if ($now == $next_time) {
$filename = format_filename($row['url']);
if (create_screenshot($row['url'], $filename)) {
$config[$index] = array(
'url' => $row['url'],
'interval' => $row['interval'],
'created_at' => $row['created_at'],
'last_shot_time' => time(),
'last_shot_file' => $filename,
);
update_config();
echo(sprintf('create_screenshot: %s , %s'.PHP_EOL, $row['url'], $filename));
} else {
echo('create_screenshot fail!'.PHP_EOL);
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question