Revision 71bd5ec1
Added by Phil Davis over 10 years ago
etc/inc/services.inc | ||
---|---|---|
2363 | 2363 |
global $config, $g; |
2364 | 2364 |
|
2365 | 2365 |
$is_installed = false; |
2366 |
$cron_changed = true; |
|
2366 | 2367 |
|
2367 | 2368 |
if (!is_array($config['cron'])) |
2368 | 2369 |
$config['cron'] = array(); |
... | ... | |
2391 | 2392 |
$config['cron']['item'][] = $cron_item; |
2392 | 2393 |
write_config(sprintf(gettext("Installed cron job for %s"), $command)); |
2393 | 2394 |
} else { |
2394 |
$config['cron']['item'][$x] = $cron_item; |
|
2395 |
write_config(sprintf(gettext("Updated cron job for %s"), $command)); |
|
2395 |
if (($config['cron']['item'][$x]['minute'] == $cron_item['minute']) && |
|
2396 |
($config['cron']['item'][$x]['hour'] == $cron_item['hour']) && |
|
2397 |
($config['cron']['item'][$x]['mday'] == $cron_item['mday']) && |
|
2398 |
($config['cron']['item'][$x]['month'] == $cron_item['month']) && |
|
2399 |
($config['cron']['item'][$x]['wday'] == $cron_item['wday']) && |
|
2400 |
($config['cron']['item'][$x]['who'] == $cron_item['who']) && |
|
2401 |
($config['cron']['item'][$x]['command'] == $cron_item['command'])) { |
|
2402 |
$cron_changed = false; |
|
2403 |
log_error(sprintf(gettext("Checked cron job for %s, no change needed"), $command)); |
|
2404 |
} else { |
|
2405 |
$config['cron']['item'][$x] = $cron_item; |
|
2406 |
write_config(sprintf(gettext("Updated cron job for %s"), $command)); |
|
2407 |
} |
|
2396 | 2408 |
} |
2397 | 2409 |
} else { |
2398 | 2410 |
if($is_installed == true) { |
... | ... | |
2400 | 2412 |
write_config(sprintf(gettext("Removed cron job for %s"), $command)); |
2401 | 2413 |
} |
2402 | 2414 |
} |
2403 |
configure_cron(); |
|
2415 |
|
|
2416 |
if ($cron_changed) |
|
2417 |
configure_cron(); |
|
2404 | 2418 |
} |
2405 | 2419 |
|
2406 | 2420 |
?> |
Also available in: Unified diff
Minimise config updates when checking cron jobs