๐พ Archived View for bbs.geminispace.org โบ s โบ Lagrange โบ 4951 captured on 2023-09-08 at 16:23:38. Gemini links have been rewritten to link to archived content
โก๏ธ Next capture (2023-09-28)
-=-=-=-=-=-=-
It would be really nice if we had the ability to use something like `lagrange --export-user-data` instead of having to export it from the app.
The reason I would like such a feature is so that I could have a scheduled task export the data to my sync directory periodically. This would make it easier to keep Lagrange in sync on my devices.
2023-08-30 ยท 9 days ago ยท ๐ naf
I have also been thinking how to backup and sync to multiple devices. I haven't tried, but it looks like you could just copy/backup the ~/.config/lagrange directory on Linux. There should be a similar folder on Windows or Mac.
Has anyone used syncthing or something else to sync your Lagrange setup across multiple devices?
In the Lagrange settings menu, there is an option Export User Data. It will export the data as a .zip file, which you can then sync with another device and import it from the Lagrange settings. You import the zip itself. This is better than copying the files from ~/.config/lagrange.
What I have in mind is that same functionality but accessible through command line argument like `--export-user-data`. With this, I'd be able to run a systemd service on a timer and have it export the zip file to my MEGA sync directory, and from there import it on other devices.
2023-08-31 ยท 9 days ago
As a suggestion, `--export-user-data` could take an optional value that would be the path of the zip export relative to the current working directory or an absolute path. If no value is supplied then just export it to the current working directory.
That would be a great feature.
I can definitely see the value of exporting user data (importing, too) via command line options. This should be fairly easy to implement. I will add this to my todo list.
2023-08-31 ยท 8 days ago
`--export-user-data` would also be able to trigger persisting the state to storage, which AFAIK isn't currently done in realtime. So the config dir might be out of date.
Oh, is that true @skyjake, the .config/lagrange files may not always be up to date?
@Supernova Many of the files are updated immediately when a change occurs in the app (bookmarks, identities, trusted certs, visited, prefs.cfg โ saving of open tabs and UI state is coming in v1.17). When the app is closed, the full navigation history content cache is additionally written to state.lgr.
So the data that is included in the export archive should always be up to date.
You should be aware that multiple instances of the app cannot safely use the same runtime directory. If you run multiple instances, you need to manually override the runtime directory in the extra instances.
@skyjake, thanks for the info. So I think a cronjob with a tar command should be enough for an automated backup. Maybe history wouldn't be up to date. Or close the app, then run the backup and reopen it again.
My use case was actually for syncing across multiple devices. Using syncthing the .config/lagrange folder could be synced in real time. Usually I would only be using one device at a time so file updates should propogate without conflict. But if for example the bookmarks file was changed on another device while Lagrange was running, would it load the new changes?