Replies: 15 comments
-
The Wifi settings already attempt to solve this problem. Under Schedule > Networks > Allowed Networks. Select only "unmetered" networks to use for automatic backups. How would the feature suggested here be different and if so how would it be implemented? |
Beta Was this translation helpful? Give feedback.
-
But the button is not visible if you don't have Wifi, yet it is possible to have a metered wired connection. |
Beta Was this translation helpful? Give feedback.
-
I think that's only implemented for OSX. On Linux with NetworkManager you can mark connections (of any type, not just WiFi) as metered, and this is honoured by some applications. NetworkManager even tries to guess that status for active connections (for example tethering through Android is marked as "guessed as metered"). The options I feel would make sense are:
|
Beta Was this translation helpful? Give feedback.
-
Using NetworkManager to grab Wifi details on Linux came up before and would be a nice addition. |
Beta Was this translation helpful? Give feedback.
-
How does the networks list work on OS X? Is it just WiFi networks? Will backup run over cable when some WiFi network is selected from the list? |
Beta Was this translation helpful? Give feedback.
-
Communication with NetworkManager takes either another dependency https://pypi.org/project/python-networkmanager/ or DBus. Which one is prefered? |
Beta Was this translation helpful? Give feedback.
-
If DBus is not too hard to implement, I'd rather avoid more deps. Else mark it as Linux-only in And before writing any code, feel free to summarize your planned implementation/changes. |
Beta Was this translation helpful? Give feedback.
-
I think we don't need python-networkmanager: the most interesting part for us is the SSID decoding function (NetworkManager provides raw SSIDs), and the library uses a different DBus implementation than Vorta already uses for notifications. And that's for enabling the WiFi block list, which I think is out of scope for this issue. For the UI I'd just add a "Don't run backup over metered networks", enabled by default, and visible only when NM is available. The actual implementation should have two parts:
|
Beta Was this translation helpful? Give feedback.
-
@m3nu do you think the approach described above is appropriate? I wonder if some additional UI that tells the user that the backup is not going to run and why would be needed, or can that be added later? I'm already thinking about other conditions, like being on battery power. |
Beta Was this translation helpful? Give feedback.
-
Yeah, this can work and it's nice to see how you guys are coming up with new ideas. Battery power is a nice option too and should be easy to implement on all OSs. |
Beta Was this translation helpful? Give feedback.
-
For the battery power, we can use psutil which is already a dependency, and a UI like [x] Run on battery power only when above [qspinbox] % charged and place it in the schedule page, only visible when there is a battery. To run only when on charger there would be a tooltip that says "Setting this to 100% will run scheduled backups only when on charger" on qspinbox |
Beta Was this translation helpful? Give feedback.
-
Is there some way to get notifications from psutil? It would be great to not just check the condition once, but actually be able to stop the backup when the conditions change. For networks it kind of happens by itself - changing the connection will probably make Borg timeout. But for battery we'd need to monitor the inputs somehow. Using something like UPower on Linux or UIKit on OSX can give us change notifications without polling, but I don't know if there's a library that abstracts over them. |
Beta Was this translation helpful? Give feedback.
-
Not that I know of, but there could be a loop to poll every second or so. I don't think its needed, since it complicates the code and isn't really relevant for the typical use-case of personal backups, which complete in a few minutes at most. |
Beta Was this translation helpful? Give feedback.
-
The backups being short is a good point, but they eat a lot of CPU. And I'm not sure if they are that short on HDDs, I've only tested on SSDs. On the other hand, is there some OS-level "low power consumption" thing we can hook into on any OS? Something like Android's battery saving? It might not be as flexible, but would be a great default. |
Beta Was this translation helpful? Give feedback.
-
macOS does have a power saving mode https://support.apple.com/en-us/HT202824 but I have no idea what the API is. Polling would be nice, but I want to reduce the complexity of this, and laptop users should know how long their battery lasts. |
Beta Was this translation helpful? Give feedback.
-
Is your feature request related to a problem? Please describe.
On a slow or metered connection backups can take most of the bandwidth.
Describe the solution you'd like
It should be possible to skip scheduled backups if the available connection is known to be metered, or even when it's not known to be unmetered. A running backup should be stopped if we lose a suitable connection.
Describe alternatives you've considered
The only alternative I know is enabling notifications and stopping the backup when I know I don't want it to run, which is not very handy.
Beta Was this translation helpful? Give feedback.
All reactions