Rename import-db3.php to maintenance.php, and allow it to pause cron.php.

This commit is contained in:
Retro_Guy 2023-09-17 05:56:24 -07:00
parent 48826b2608
commit 54ae9071b5
2 changed files with 7 additions and 1 deletions

View File

@ -7,7 +7,7 @@ include $config_dir . "/gpg.conf";
$pid = getmypid();
$logfile = $logdir . '/cron.log';
if (file_exists($config_dir . '/cron.disable')) {
if (file_exists($config_dir . '/cron.disable') || file_exists($spooldir . '/cron.disable')) {
file_put_contents($logfile, "\n" . date('M d H:i:s') . " " . $config_name . " cron.php disabled by semaphore: " . $config_dir . "/cron.disable Exiting...", FILE_APPEND);
chown($logfile, $CONFIG['webserver_user']);
exit();

View File

@ -26,6 +26,8 @@ include ("$file_newsportal");
$logfile = $logdir . '/import.log';
$lockfile = $lockdir . '/' . $config_name . '-spoolnews.lock';
$cronfile = $spooldir.'/cron.disable';
$pid = file_get_contents($lockfile);
if (posix_getsid($pid) === false || ! is_file($lockfile)) {
print "Starting Import...\n";
@ -35,6 +37,8 @@ if (posix_getsid($pid) === false || ! is_file($lockfile)) {
exit();
}
touch ($cronfile);
if (! isset($argv[1])) {
$argv[1] = "-help";
}
@ -74,8 +78,10 @@ if ($argv[1][0] == '-') {
echo "-reset: Reset a group to restart from zero messages (-reset alt.test)\n";
break;
}
unlink($cronfile);
exit();
} else {
unlink($cronfile);
exit();
}