[pbs-devel] [RFC PATCH 3/4] fix #3786: ui/cli: add deep sync option to ui and cli
Stefan Sterz
s.sterz at proxmox.com
Wed Jun 15 10:20:39 CEST 2022
make "deep sync" an advanced option because: a) you need to know that
it has no effect unless a previous verify job has been executed b) it
might take a lot more time to finish since it has to check each
manifest and c) the default "off" should be what most users want.
Signed-off-by: Stefan Sterz <s.sterz at proxmox.com>
---
src/bin/proxmox-backup-manager.rs | 13 +++++++++++--
www/window/SyncJobEdit.js | 11 +++++++++++
2 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/src/bin/proxmox-backup-manager.rs b/src/bin/proxmox-backup-manager.rs
index 89598c90..0c0191dd 100644
--- a/src/bin/proxmox-backup-manager.rs
+++ b/src/bin/proxmox-backup-manager.rs
@@ -12,8 +12,8 @@ use proxmox_sys::fs::CreateOptions;
use pbs_api_types::percent_encoding::percent_encode_component;
use pbs_api_types::{
BackupNamespace, GroupFilter, RateLimitConfig, SyncJobConfig, DATASTORE_SCHEMA,
- GROUP_FILTER_LIST_SCHEMA, IGNORE_VERIFIED_BACKUPS_SCHEMA, NS_MAX_DEPTH_SCHEMA,
- REMOTE_ID_SCHEMA, REMOVE_VANISHED_BACKUPS_SCHEMA, UPID_SCHEMA,
+ DEEP_SYNC_BACKUPS_SCHEMA, GROUP_FILTER_LIST_SCHEMA, IGNORE_VERIFIED_BACKUPS_SCHEMA,
+ NS_MAX_DEPTH_SCHEMA, REMOTE_ID_SCHEMA, REMOVE_VANISHED_BACKUPS_SCHEMA, UPID_SCHEMA,
VERIFICATION_OUTDATED_AFTER_SCHEMA,
};
use pbs_client::{display_task_log, view_task_result};
@@ -260,6 +260,10 @@ fn task_mgmt_cli() -> CommandLineInterface {
schema: NS_MAX_DEPTH_SCHEMA,
optional: true,
},
+ "deep-sync": {
+ schema: DEEP_SYNC_BACKUPS_SCHEMA,
+ optional: true,
+ },
"group-filter": {
schema: GROUP_FILTER_LIST_SCHEMA,
optional: true,
@@ -284,6 +288,7 @@ async fn pull_datastore(
ns: Option<BackupNamespace>,
remove_vanished: Option<bool>,
max_depth: Option<usize>,
+ deep_sync: Option<bool>,
group_filter: Option<Vec<GroupFilter>>,
limit: RateLimitConfig,
param: Value,
@@ -319,6 +324,10 @@ async fn pull_datastore(
args["remove-vanished"] = Value::from(remove_vanished);
}
+ if let Some(deep_sync) = deep_sync {
+ args["deep-sync"] = Value::from(deep_sync);
+ }
+
let result = client.post("api2/json/pull", Some(args)).await?;
view_task_result(&client, result, &output_format).await?;
diff --git a/www/window/SyncJobEdit.js b/www/window/SyncJobEdit.js
index 948ad5da..da1b0bed 100644
--- a/www/window/SyncJobEdit.js
+++ b/www/window/SyncJobEdit.js
@@ -232,6 +232,17 @@ Ext.define('PBS.window.SyncJobEdit', {
editable: '{isCreate}',
},
},
+ {
+ fieldLabel: gettext('Deep sync'),
+ xtype: 'proxmoxcheckbox',
+ name: 'deep-sync',
+ autoEl: {
+ tag: 'div',
+ 'data-qtip': gettext('Check if all snapshots passed the last verification job and if not re-sync them?'),
+ },
+ uncheckedValue: false,
+ value: false,
+ },
],
},
{
--
2.30.2
More information about the pbs-devel
mailing list