From e0982fe7a18254db048bfe28932e98b72907b1da Mon Sep 17 00:00:00 2001 From: shuki Date: Wed, 4 Mar 2026 17:38:46 +0200 Subject: [PATCH] Add --sysbackup flag to Cron.pm cron line builder Cron.pm's install_schedule() had its own cron line builder that didn't include --sysbackup. Now it checks SYSBACKUP=yes in the schedule config and appends --sysbackup to the cron command. Co-Authored-By: Claude Opus 4.6 --- whm/gniza-whm/lib/GnizaWHM/Cron.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/whm/gniza-whm/lib/GnizaWHM/Cron.pm b/whm/gniza-whm/lib/GnizaWHM/Cron.pm index 75b0101..9f18197 100644 --- a/whm/gniza-whm/lib/GnizaWHM/Cron.pm +++ b/whm/gniza-whm/lib/GnizaWHM/Cron.pm @@ -78,13 +78,16 @@ sub install_schedule { return (0, $err) unless defined $cron_expr; # Build full cron command line - my $remote_flag = ''; + my $extra_flags = ''; my $remotes = $conf->{REMOTES} // ''; $remotes =~ s/^\s+|\s+$//g; if ($remotes ne '') { - $remote_flag = " --remote=$remotes"; + $extra_flags .= " --remote=$remotes"; } - my $cmd_line = "$cron_expr $GNIZA_BIN backup${remote_flag} >> /var/log/gniza/cron-${name}.log 2>&1"; + if (($conf->{SYSBACKUP} // '') eq 'yes') { + $extra_flags .= " --sysbackup"; + } + my $cmd_line = "$cron_expr $GNIZA_BIN backup${extra_flags} >> /var/log/gniza/cron-${name}.log 2>&1"; # Read current crontab, strip existing entry for this schedule, append new my $crontab = _read_crontab();