backintime
backintime copied to clipboard
Can't modify settings for a backup disk that is not mounted
Context : I have 2 backup profiles in backintime:
- one (called "Local") for backups on an internal SATA HDD.
- one other (called "Remote") for backups on an external USB HDD that I keep off-site.
What is happening : I can't open Remote profile in backintime, modify settings and save them, EXCEPT when the off-site USB HDD is mounted. If I try to that without the disk, I get "mountpoint is not folder !" (mountpoint is where is he USB HDD is usually mounted) when trying to save modified settings.
And I don't want to create a permanent mountpoint folder, as I let Ubuntu handle USB disk mounting/unlocking (they are automounted in /media/user )
Workaround : edit backintime config file by hand, but it's a bit dangerous and tedious.
What I expect : modify settings for a backup disk that is not mounted.
@Saroumane There is a new forming maintaining team and we do review all issues. Is this problem still relevant for you or did you find a solution?
Tag: Feature, Qt, Discussion
Hello,
~I just checked : it seems that now Ubuntu (22.04) keeps permanent folders for mountpoints~,
I have now a permanent moutpoint in /etc/fstab and thus a permanent folder in /media/root : so I don't have the problem anymore.
Maybe @ojob @DanieLoche or @aryoda could tell if they are (still) affected ?
This problem still exists. In my case, there is a profile whose snapshot folder resides under a mountpoint which is writable to my user when the drive is mounted, but non-writable (owned by root) when the drive is unmounted.
When trying to edit the settings for that profile with an unmounted drive, the following message appears:

In consequence, it is not possible to modify the settings through the GUI while the drive is unmounted.
I was also stumbling over this problem when I just wanted to change the backup schedule for a non-mounted target device.
I have not re-tested it with Ubuntu 22.04 but 20.04 with the current DEV version (and the issue remains the same by blocking to save the changed profile).
I have now a permanent mountpoint in /etc/fstab and thus a permanent folder in /media/root : so I don't have the problem anymore.
The thing is that
- starting a backup without the mounted target device would write the snapshots to your mount point instead of to the external device (maybe even without any notice)
- BiT can not list the existing snapshots without accessing the target device
- some settings may not be changed if the drive is not mounted (eg. since the "where to save snapshots" folder structure is not completely navigable - the same applies if the "include" files were located on a non-mounted device)
@emtiu I personally would not classify this as a bug but as an overly restrictive GUI and this issue as a feature request.
But anyhow: A possibly better solution could be:
- If a source or target drive is not mounted for a selected profile the GUI shall still allow to edit all settings that are NOT related to the mount(s). The other settings (and buttons like "restore" or "take snapshot" are disabled/read-only). Show somewhere a hint that some settings cannot be changed due to the missing mount (status bar or once as a pop-up).
- If I want to save a changed profile with a non-mounted device I no longer get a blocking pop-up message ("... is not a folder") but a warning and can still save only the changed parts
- The list of snapshots shall be empty but instead of "new" display a hint like "device must be mounted to show existing snapshots". Additionally show a similar warning in the status bar...
Open issue(s):
- What is the impact of an existing user-callback script that eg. contains "just-in-time" mounts?
Information from #962 (closed as duplicate of this Issue): This also affects "Local encrypted" backup locations, where the encryption password is prompted every time a setting is changed.
In the same way, I imagine (but have not tested) that "SSH encrypted" locations are also affected, as well as "SSH" locations, if they require an interactively entered password/key passphrase.
I think I could implement a minimal "no mount-relevant changes" check by comparing the GUI state (values from the Qt widgets) with the current config values and suppress the validations that require an accessible mount.
What I could implement: If no mount-relevant settings have been changed I could ask the user if the settings shall be saved without validating the snapshot target settings (since they are unchanged).
The challenge is that I cannot easily recognize a missing mount without provoking the unwanted error message(s).
This is imperfect because a user could choose "yes, save without snapshot target validation" even though the mount may be available for validation and the validation error is postponed (happens when the next backup starts)
I see no easy implementation without digging deeper so I stop here now to work on higher prioritized issues for the next stabilized BiT release before coming back here...
Current implementation
-
The config file is always saved when you click
OKin the settings button by callinghttps://github.com/bit-team/backintime/blob/b4dd2d1737c5031d264d667c18f6987a1916762b/qt/settingsdialog.py#L1753-L1755 which calls the "validation" of the profile (misnamed, should be named eg.
saveProfileAction)https://github.com/bit-team/backintime/blob/b4dd2d1737c5031d264d667c18f6987a1916762b/qt/settingsdialog.py#L1497-L1507
which firstly updates the in-memory
configobject from the GUI state (Qt widgets) by calling this method (misnamed, should be eg.updateConfigFromGuiState)https://github.com/bit-team/backintime/blob/b4dd2d1737c5031d264d667c18f6987a1916762b/qt/settingsdialog.py#L1200
and is doing then some more checks for invalid paths in
self.config.checkConfigand updating the crontab insetupCron. -
The validation errors preventing to store the changes are thrown from
"
is not folder !" + "Can't write to: ... Are you sure you have write access ?": -> `settingsdialog.saveProfile() https://github.com/bit-team/backintime/blob/b4dd2d1737c5031d264d667c18f6987a1916762b/qt/settingsdialog.py#L1417Ask for password...: -> when mounting in
saveProfile()during thepreMountCheck:https://github.com/bit-team/backintime/blob/b4dd2d1737c5031d264d667c18f6987a1916762b/qt/settingsdialog.py#L1359