Rename import-db3.php to maintenance.php, and allow it to pause cron.php.
This commit is contained in:
parent
48826b2608
commit
54ae9071b5
|
@ -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();
|
||||
|
|
6
Rocksolid_Light/rslight/scripts/tools/import-db3.php → Rocksolid_Light/rslight/scripts/tools/maintenance.php
Executable file → Normal file
6
Rocksolid_Light/rslight/scripts/tools/import-db3.php → Rocksolid_Light/rslight/scripts/tools/maintenance.php
Executable file → Normal 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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue