From: Jonas Theisen <j.theisen@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [PATCH proxmox-backup 05/14] fix #7904: Implement "Enable" checkbox for Sync jobs
Date: Wed, 30 Sep 2026 17:18:03 +0200 [thread overview]
Message-ID: <20260930152131.317493-6-j.theisen@proxmox.com> (raw)
In-Reply-To: <20260930152131.317493-1-j.theisen@proxmox.com>
To allow users to disable a sync job without having to remove the
schedule this patch introduces an "Enable" checkbox.
The value is inserted into the job config and honored by
the scheduler by skipping disabled jobs altogether.
If the value is not present in a job config it is assumed the job
is to be enabled for backwards compatibility.
If the job is disabled the schedule input box in the UI is also
disabled and such is configured to not allow empty inputs anymore.
Signed-off-by: Jonas Theisen <j.theisen@proxmox.com>
---
src/api2/admin/sync.rs | 10 +++++++++-
src/api2/config/sync.rs | 4 ++++
src/bin/proxmox-backup-proxy.rs | 8 ++++++++
www/window/SyncJobEdit.js | 26 ++++++++++++++++++++++++--
4 files changed, 45 insertions(+), 3 deletions(-)
diff --git a/src/api2/admin/sync.rs b/src/api2/admin/sync.rs
index 1799f51c0..39fe7c648 100644
--- a/src/api2/admin/sync.rs
+++ b/src/api2/admin/sync.rs
@@ -112,7 +112,15 @@ pub fn list_config_sync_jobs(
continue;
}
- let status = compute_schedule_status("syncjob", &job.id, job.schedule.as_deref())?;
+ let mut status = compute_schedule_status("syncjob", &job.id, job.schedule.as_deref())?;
+
+ let enabled = match job.enable {
+ Some(c) => c,
+ None => true,
+ };
+ if !enabled {
+ status.next_run = Some(0);
+ }
list.push(SyncJobStatus {
config: job,
diff --git a/src/api2/config/sync.rs b/src/api2/config/sync.rs
index 068e2619c..f23a66df0 100644
--- a/src/api2/config/sync.rs
+++ b/src/api2/config/sync.rs
@@ -674,6 +674,9 @@ pub fn update_sync_job(
if update.schedule.is_some() {
data.schedule = update.schedule;
}
+ if let Some(enable) = update.enable {
+ data.enable = Some(enable);
+ }
if update.remove_vanished.is_some() {
data.remove_vanished = update.remove_vanished;
}
@@ -819,6 +822,7 @@ acl:1:/remote/remote1/remotestore1:write@pbs:RemoteSyncOperator
max_depth: None,
group_filter: None,
schedule: None,
+ enable: None,
limit: pbs_api_types::RateLimitConfig::default(), // no limit
transfer_last: None,
encrypted_only: None,
diff --git a/src/bin/proxmox-backup-proxy.rs b/src/bin/proxmox-backup-proxy.rs
index 22abfdbdb..ddeeff721 100644
--- a/src/bin/proxmox-backup-proxy.rs
+++ b/src/bin/proxmox-backup-proxy.rs
@@ -684,6 +684,14 @@ async fn schedule_datastore_sync_jobs() {
None => continue,
};
+ let job_enabled = match job_config.enable {
+ Some(c) => c,
+ None => true, //if not defined assume enabled for backwards compatibility
+ };
+ if !job_enabled {
+ continue;
+ }
+
let worker_type = "syncjob";
if check_schedule(worker_type, &event_str, &job_id) {
let job = match Job::new(worker_type, &job_id) {
diff --git a/www/window/SyncJobEdit.js b/www/window/SyncJobEdit.js
index 961ce2951..9ff949b22 100644
--- a/www/window/SyncJobEdit.js
+++ b/www/window/SyncJobEdit.js
@@ -97,6 +97,10 @@ Ext.define('PBS.window.SyncJobEdit', {
} else {
values.location = 'remote';
}
+
+ if (!values.schedule || values.schedule === '') {
+ values.enable = false;
+ }
me.callParent([values]);
},
@@ -203,13 +207,31 @@ Ext.define('PBS.window.SyncJobEdit', {
deleteEmpty: '{!isCreate}',
},
},
+ {
+ xtype: 'proxmoxcheckbox',
+ fieldLabel: gettext('Enable'),
+ name: 'enable',
+ autoEl: {
+ tag: 'div',
+ 'data-qtip': gettext('Enable scheduled execution of this task.'),
+ },
+ listeners: {
+ change: function (field, enabled) {
+ let me = this;
+ let view = me.up('pbsSyncJobEdit');
+ let schedule = view.down('field[name=schedule]');
+ schedule.setDisabled(!enabled);
+ },
+ },
+ uncheckedValue: false,
+ value: true,
+ },
{
xtype: 'pbsCalendarEvent',
name: 'schedule',
fieldLabel: gettext('Sync Schedule'),
- emptyText: gettext('none'),
+ allowBlank: false,
cbind: {
- deleteEmpty: '{!isCreate}',
value: '{scheduleValue}',
},
},
--
2.47.3
next prev parent reply other threads:[~2026-09-30 15:22 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-30 15:17 [PATCH proxmox{,-backup} 00/14] fix #7904: Implement Enable checkboxes for all jobs Jonas Theisen
2026-09-30 15:17 ` [PATCH proxmox 01/14] fix #7904: Add 'enable' to sync job schema Jonas Theisen
2026-09-30 15:18 ` [PATCH proxmox 02/14] fix #7904: Add 'enable' to verify " Jonas Theisen
2026-09-30 15:18 ` [PATCH proxmox 03/14] fix #7904: Add 'enable' to datastore config and GC " Jonas Theisen
2026-09-30 15:18 ` [PATCH proxmox 04/14] fix #7904: Add 'enable' to Tape backup " Jonas Theisen
2026-09-30 15:18 ` Jonas Theisen [this message]
2026-09-30 15:18 ` [PATCH proxmox-backup 06/14] fix #7904: Implement "Enable" checkbox for Verify jobs Jonas Theisen
2026-09-30 15:18 ` [PATCH proxmox-backup 07/14] fix #7904: Implement "Enable" checkbox for GC jobs Jonas Theisen
2026-09-30 15:18 ` [PATCH proxmox-backup 08/14] fix #7904: Implement "Enable" checkbox for Tape backup jobs Jonas Theisen
2026-09-30 15:18 ` [PATCH proxmox-backup 09/14] fix #7904: Improve visibility of disabled GC on the overview page Jonas Theisen
2026-09-30 15:18 ` [PATCH proxmox-backup 10/14] fix #7904: Improve visibility of disabled Verify jobs " Jonas Theisen
2026-09-30 15:18 ` [PATCH proxmox-backup 11/14] fix #7904: Improve visibility of disabled Sync " Jonas Theisen
2026-09-30 15:18 ` [PATCH proxmox-backup 12/14] fix #7904: Improve visibility of disabled Tape Backup " Jonas Theisen
2026-09-30 15:18 ` [PATCH proxmox-backup 13/14] fix #7904: Remove clear button from calendar selector Jonas Theisen
2026-09-30 15:18 ` [PATCH proxmox-backup 14/14] fix #7904: Align Prune Edit window to other "Enable" checkboxes Jonas Theisen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260930152131.317493-6-j.theisen@proxmox.com \
--to=j.theisen@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox