From ce3371fe969733c92cd91fe31d2acb69fc877986 Mon Sep 17 00:00:00 2001 From: PiBa-NL Date: Sat, 1 Jul 2017 23:01:08 +0200 Subject: cron, fix job removal by index splice and write valid schedules for ramdrive backups --- src/etc/inc/services.inc | 2 +- src/usr/local/www/system_advanced_misc.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/etc/inc/services.inc b/src/etc/inc/services.inc index f7aadd8..3055619 100644 --- a/src/etc/inc/services.inc +++ b/src/etc/inc/services.inc @@ -2868,7 +2868,7 @@ function install_cron_job($command, $active = false, $minute = "0", $hour = "*", } } else { if ($is_installed == true) { - unset($config['cron']['item'][$x]); + array_splice($config['cron']['item'], $x, 1); $change_message = "Removed cron job for %s"; } else { $cron_changed = false; diff --git a/src/usr/local/www/system_advanced_misc.php b/src/usr/local/www/system_advanced_misc.php index c2f6be7..7c63537 100644 --- a/src/usr/local/www/system_advanced_misc.php +++ b/src/usr/local/www/system_advanced_misc.php @@ -271,9 +271,9 @@ if ($_POST) { install_cron_job("/etc/rc.backup_logs.sh", false, null, null, null, null, null, null, false); } else { /* See #7146 for detail on why the extra parameters are needed for the time being. */ - install_cron_job("/etc/rc.backup_rrd.sh", ($config['system']['rrdbackup'] > 0), $minute="0", "*/{$config['system']['rrdbackup']}", null, null, null, null, false); - install_cron_job("/etc/rc.backup_dhcpleases.sh", ($config['system']['dhcpbackup'] > 0), $minute="0", "*/{$config['system']['dhcpbackup']}", null, null, null, null, false); - install_cron_job("/etc/rc.backup_logs.sh", ($config['system']['logsbackup'] > 0), $minute="0", "*/{$config['system']['logsbackup']}", null, null, null, null, false); + install_cron_job("/etc/rc.backup_rrd.sh", ($config['system']['rrdbackup'] > 0), $minute="0", "*/{$config['system']['rrdbackup']}", '*', '*', '*', 'root', false); + install_cron_job("/etc/rc.backup_dhcpleases.sh", ($config['system']['dhcpbackup'] > 0), $minute="0", "*/{$config['system']['dhcpbackup']}", '*', '*', '*', 'root', false); + install_cron_job("/etc/rc.backup_logs.sh", ($config['system']['logsbackup'] > 0), $minute="0", "*/{$config['system']['logsbackup']}", '*', '*', '*', 'root', false); } write_config(); -- cgit v1.1