From 0da580666ce652c4ab8319132b338c4adc525b97 Mon Sep 17 00:00:00 2001 From: shuki Date: Wed, 4 Mar 2026 17:36:20 +0200 Subject: [PATCH] Always reinstall cron when saving a schedule Previously the cron was only updated if it was already active. Now every save reinstalls the cron entry so changes (like enabling --sysbackup) take effect immediately. Co-Authored-By: Claude Opus 4.6 --- whm/gniza-whm/schedules.cgi | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/whm/gniza-whm/schedules.cgi b/whm/gniza-whm/schedules.cgi index f58eb55..e1845d0 100644 --- a/whm/gniza-whm/schedules.cgi +++ b/whm/gniza-whm/schedules.cgi @@ -252,11 +252,8 @@ sub handle_edit { if (!@errors) { my ($ok, $err) = GnizaWHM::Config::write($conf_path, \%data, \@GnizaWHM::Config::SCHEDULE_KEYS); if ($ok) { - # Re-install cron if it was active, so timing/remote changes take effect - my $cron_schedules = GnizaWHM::Cron::get_current_schedules(); - if (exists $cron_schedules->{$name}) { - GnizaWHM::Cron::install_schedule($name); - } + # Always reinstall cron so changes take effect immediately + GnizaWHM::Cron::install_schedule($name); GnizaWHM::UI::set_flash('success', "Schedule '$name' updated successfully."); print "Status: 302 Found\r\n"; print "Location: schedules.cgi\r\n\r\n";