seedvault icon indicating copy to clipboard operation
seedvault copied to clipboard

Add option to only backup/upload when connected to (unmetered) Wi-Fi

Open mozzieongit opened this issue 2 years ago • 10 comments

I often find myself in a situation where I have to turn off Wi-Fi (like when leaving home), but the backup continues. (I'm not sure if I had the situation, that a backup started on the road.)

My backup location is Nextcloud. And due to limited mobile data volume, it's necessary to stop uploading on cellular.

mozzieongit avatar Aug 06 '22 16:08 mozzieongit

I'd like to see this too. Going further, I'd like a mode where backups happen only on external power and unmetered wifi, and if daily will start if say 21h have passed, or maybe just a date after the previous backup. I think lots of people have a daily cyclec where normally they plug the phone in for a while on unmetered wifi. It might then do backups anyway after 2 or 3 days. But, for people that meet the battery/wifi tests often enough, it would mean seedvault uses almost no cell data and very little battery.

I know the UI should stay simple, so I suggest either: not configurable: backup runs on wifi/cell when date is different from last backup. Runs when date is +3 anyway., then +6. After that reverts to daily until one succeeds on wifi/power

have checkmarks for "try to backup on external power only" and "try to backup on unmetered wifi only" and then a "# days to defer before backing up if desired conditions are not met" default to yes/yes/2 so if monday had wifi/cell, no backup tues, wed, but to it anyway thursday

gdt avatar Aug 06 '22 22:08 gdt

We already don't do backups on metered connections: https://github.com/seedvault-app/seedvault/pull/291

If the system has started a backup on an unmetered connection and you switch to metered, the backup might continue, but new apps should reject backup.

grote avatar Aug 15 '22 20:08 grote

Related: https://github.com/seedvault-app/seedvault/issues/405

grote avatar Aug 15 '22 20:08 grote

If the system has started a backup on an unmetered connection and you switch to metered, the backup might continue, but new apps should reject backup.

Hmm, since the last update/recently (Android 13, CalyxOS 4.6.1 currently, seedvault 13-3.3) I have horrible data usage of Nextcloud - which is used as my uploading backup currently.. From what I saw the problem may be the following: Seedvault has pushed many little files to the Nextcloud app to upload while being on an unmetered network. Now, however, Nextcloud takes some time and uploads them one-by-one sequentially, so when switching to a metered network it still has a backlog of X files to upload. And as the upload is "user initiated" (i.e. AFAIK the Nextcloud app cannot distinguish between uploads from Seedvault vs user-initiated or other uploads), it just continues to upload. There is no flag "stop/pause upload on metered network" you can pass to the Nextcloud app, can you?

What about data backups, e.g.? Does maybe one data backup start and not stop when switching to a metered network? I have a large backup folder for Signal, maybe that is a problem.

I am considering switching to WebDAV as CalyxOS recommends, but apart from missing documentation what I now need to enter into DAVx5, I am unsure of whether that would even solve the problem.

rugk avatar Mar 07 '23 21:03 rugk

Maybe also a manual way to cancel a running backup could mitigate the problem somewhat (for now)?

rugk avatar Mar 07 '23 21:03 rugk

I am considering switching to WebDAV as CalyxOS recommends, but apart from missing documentation what I now need to enter into DAVx5, I am unsure of whether that would even solve the problem.

It looked aaif that was better, but apparently not? Today, I got another notification way too much data was used.

Screenshot_20231115-200733_1

1,3 GB of precious mobile data 🙈

Really bad. Maybe DavX5 would also need to accept a flag like "only upload on wifi" for data packages/files passed to it? If so, it could automatically stop or pause such data uploads.

In any case IMHO this needs a solution and is not acceptable for a backup solution.

And BTW why is this issue (still?) marked as "invalid"?

rugk avatar Nov 15 '23 19:11 rugk

Because of https://github.com/seedvault-app/seedvault/issues/431#issuecomment-1215751245

grote avatar Nov 27 '23 12:11 grote

If you have helpful information, please add it to https://github.com/seedvault-app/seedvault/issues/405

grote avatar Nov 27 '23 12:11 grote

Hmm would need to take a logcat… thing is just it is hard to notice right after the fact or even have a logcat in the first place.

but new apps should reject backup.

What does that mean BTW? So the current behavior is as following: If you switch to metered, the app currently being backed-up continues, but the app afterwards should then cancel the backup? Or pause it until a unmetered connection comes again? If so 1.3 GB of mobile data I encountered is still quite much hmm.

rugk avatar Nov 28 '23 00:11 rugk

Seedvault also used almost a GB of mobile data from my 3 GB data plan. This unfortunately means that i have to disable the app, because this is just too much. I don't think that my logs contain any useful information, because the are probably too new, but you can have a look anyway. seedvault-13-3.3-1708862007033.txt

major-mayer avatar Feb 25 '24 20:02 major-mayer