For flatpaks and brews I don’t back up the things themselves, but the names of the things I have installed. I assume that whatever I’ve installed will be available to reinstall from flathub or the brewery (whatever they call it). This is what I do:
flatpak list --app --columns=application >~/.config/system/flatpaks.txt
brew list --installed-on-request >~/.config/system/brews.txt
Back up ~/.config/system
somewhere. I use a usb drive. Then when you need to restore them:
xargs -a flatpaks.txt flatpak install
xargs -a brews.txt brew install
Distroboxes are meant to be somewhat transient, and I’m not aware of a good way to back up the actual container files. Backing up all of .local might do it. You could also take a more declarative approach and use additional_packages in you distrobox.ini file. See /etc/distrobox/apps.ini for an example called mlbox.
You also need to back up anything you change in /etc. That is the most challenging thing, as both the user and the system change files. I.e. you add a mount to fstab, but if you reinstall the system, the UUIDs of all the partitions will have changed. There are also soft links into /usr/share
. It’s a kaka show.
Open to suggestions about this myself.
I previously asked about etc , but didn’t work out a definitive way to back it up. I have a few files that I back up that are hard to reproduce: my key files for luks and zfs, /etc/crypttab, /etc/fstab for reference.
Several of my questions about backup and restore went unanswered. here, here, here.
Due to all of this, I do a bare metal backup of my root nvme drive to an external nvme drive (one of three, in rotation) once a week. If all else fails, I have something to fall back on. I boot a CloneZilla USB and use ddrescue
to make the copy.
Oh, let’s not forget there are SELinux permissions that need to be backed up or fixed when files are restored. sudo restorecon
is your friend here.
As for other drives/folders, I use rsync to do incremental backups of btrfs snapshots of root and var, my working drive, and my home drive (which is on a separate drive).
I also use Vorta to do incremental backups of my zfs array to a drive on my iMac Pro that is then backed up to Backblaze.
I’m currently thinking about taking backups to my bank, to be stored in a safe deposit box.
Maybe some of this will help. I think it is a subject that is both important, and neglected. I’m not sure why my other posts went unanswered, possibly because people are afraid to make suggestions because it is important, or people just don’t know. Or perhaps I’m over complicating it, and everything is obvious. Always a possibility 