Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1265,6 +1265,16 @@ def setRsyncOptions(self, enabled, value, profile_id = None):
self.setProfileBoolValue('snapshots.rsync_options.enabled', enabled, profile_id)
self.setProfileStrValue('snapshots.rsync_options.value', value, profile_id)

# Advanced Rsync User Extensions

def dryRun(self, profile_id=None):
return self.profileBoolValue('snapshots.dry_run', False, profile_id)

def setDryRun(self, value, profile_id=None):
self.setProfileBoolValue('snapshots.dry_run', value, profile_id)



def sshPrefixEnabled(self, profile_id = None):
#?Add prefix to every command which run through SSH on remote host.
return self.profileBoolValue('snapshots.ssh.prefix.enabled', False, profile_id)
Expand Down
10 changes: 9 additions & 1 deletion qt/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1175,6 +1175,10 @@ def _update_backup_status(self, force_wait_lock=False):

self._handle_fake_busy(fake_busy, paused)

if force_update and self.config.dryRun():
# Automatically show the dry-run simulation report to the user
self._slot_backup_open_last_log()

if not self.act_take_snapshot.isEnabled():
# TODO: check if there is a more elegant way than always get a
# new snapshot list which is very expensive (time)
Expand All @@ -1186,7 +1190,11 @@ def _update_backup_status(self, force_wait_lock=False):
takeSnapshotMessage = (0, _('Done'))
else:
if takeSnapshotMessage[0] == 0:
takeSnapshotMessage = (0, _('Done, no backup needed'))
if self.config.dryRun():
msg = _('Dry run complete, no backup created')
else:
msg = _('Done, no backup needed')
takeSnapshotMessage = (0, msg)

# Check `activate_shutdown` here, instead of shutdownagent.py
# function `shutdown` should just focus on shutting down a machine
Expand Down
17 changes: 17 additions & 0 deletions qt/manageprofiles/tab_expert_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,21 @@ def __init__(self, parent): # noqa: PLR0915
)
tab_layout.addWidget(self._cb_preserve_xattr)

# Advanced Custom Rsync Flags UI Block
tab_layout.addWidget(HLineWidget())
tab_layout.addWidget(QLabel(_("Advanced Rsync Flags:")))
adv_grid = QGridLayout()
adv_grid.setColumnMinimumWidth(0, 20)
tab_layout.addLayout(adv_grid)



self._cb_dry_run = QCheckBox(_('Dry Run / Preview Mode'), self)
qttools.set_wrapped_tooltip(self._cb_dry_run, _("Uses 'rsync --dry-run'. Preview changes without writing data to the destination."))
adv_grid.addWidget(self._cb_dry_run, 1, 1)

tab_layout.addWidget(HLineWidget())

self._wdg_copy_links = CopySymlinksWidget(self)
tab_layout.addWidget(self._wdg_copy_links)

Expand Down Expand Up @@ -352,6 +367,7 @@ def load_values(self):
self._spb_bwlimit.setValue(self.config.bwlimit())
self._cb_preserve_acl.setChecked(self.config.preserveAcl())
self._cb_preserve_xattr.setChecked(self.config.preserveXattr())
self._cb_dry_run.setChecked(self.config.dryRun())

all_links = self.config.copyLinks()
only_external = self.config.copyUnsafeLinks()
Expand Down Expand Up @@ -383,6 +399,7 @@ def store_values(self):
self._spb_bwlimit.value())
self.config.setPreserveAcl(self._cb_preserve_acl.isChecked())
self.config.setPreserveXattr(self._cb_preserve_xattr.isChecked())
self.config.setDryRun(self._cb_dry_run.isChecked())

self.config.setCopyLinks(self._wdg_copy_links.all_links)
self.config.setCopyUnsafeLinks(
Expand Down