Before I start this on my own, I thought I would check in with you all, in case someone smarter has already done this.
If I am travelling to certain countries, I may want to support the following sort of use case. And of course, I want it to all be easy and obvious. I have the standard sorts of things that a data-app developer would have, like multiple browser profiles, multiple database for different database apps, a few mail accounts, rather a lot of local copies of github repos, both built and un-built. And so forth and so on. For example, I am not a journalist who keeps info that a government might be hostile to, but I have some of the same concerns.
I want to:
save everything on my laptop
erase everything on my laptop, doing a secure delete, installing a fresh copy of my OS (Ubuntu 20.04.3)
restore parts of my system from urls that I have set up.
One would need partial restores like:
not all of the apps,
just one of the email accounts and not the others,
just one browser profile,
just some of the databases, not all,
just some of the github projects.
Not much to ask for, is it? :–) But it seems to me that since I found the salt framework-laptop setup thing here, this might be the same sort of thing.
Folder-level encryption is good. But sometimes it is most secure to not have something there at all. Then if one needs it, download it. Let’s suppose we are able to download encrypted files securely.
Automating the saving of everything on your laptop should be easy depending on what you’re saving. It would be relatively easy to set up a backup script that runs as a scheduled cron job. This script could just zip up your /home directory and send it to your remote backup, you can even have those zips encrypted in case your worried about that. If there is anything outside of the home directory like the browser profiles you mentioned, you would probably want the script to dump those into home for the backup.
Automating the secure deletion and re-imaging is going to be harder to automate, since doing a secure erase on an ssd would need a bootable tool like Parted Magic and then of course a bootable source for your Ubuntu Image. Short of bringing those USB’s with you, I am unsure about how you would go about doing that remotely, as any kind of network boot based solution would require that your server be on the local network with the laptop.
As for the restore, That would just be more shell scripting, you could pull a list of installed packages beforehand and essentially just have the script install them all through your package manager. The Email I am unsure about, depending on your client you may be able to pull a configuration file that you can restore from. If not, as long as there is a command line way to configure the email account you can script it. Browser profile should be a config file that you can pull and restore from. I don’t know where your databases are stored and what would need to go into restoring those (just logging back into remote databases, or like microsoft access files or something similar?). Same with the Github Projects, if your repos are stored remotely anyway then you would just automate setting up git and re-cloning your repos to your host. As for your files, the restore script could reach out to your remote source where you keep your backups and unzip/copy everything back to where it belongs. You would also want your backup script included in the restoration process so you can continue to have your files backed up from your fresh system.
Hope that helps illuminate some of the steps, I’m thinking of undertaking a similar process myself to back up my machines to my own server. The hope would be that you could script your backup and restore processes so that you don’t have to think about backing up your machine and restoring it would be as simple as downloading and running your restore script. For testing all of this, I would advise setting up a virtual machine with enough disk space and snapshots of the fresh install. This way you can back up your system and try restoring all of it to the VM and seeing what works and what doesn’t.
As for where to start, you would be looking to do something like this, but storing your backups to a remote location:
Also true, Unfortunately I don’t know of any backup software that would backup and restore all of the specifics they have asked for. Any of the ones I can think of for Linux are either just going to be file backups or full system & disk images. For what they are looking for, some custom scripts would probably be the easiest and most effective, especially since the concern is backing up from anywhere remotely and being able to restore on the fly.