What is the best way to back up as much as possible of Debian 12 on my laptop to a server that has SSH available? I am currently backing up my users /home/ folder, but I would like to be able to nuke and restore the system from a backup.
I have ventoy on an external drive if that helps any.
P.S. I would like to be able to do incremental backups too.
15 Comments
bizdelnick@lemmy.ml · 9 pts · 2y
The standard answer: don't backup the system, automate its deployment instead. Backup only data.
waspentalive@lemmy.ml · 3 pts · 2y
Even for a home system? Not a fleet of data center servers. I am currently using rsync to backup /home/<>/ to the ssh server. I tend to make a lot of changes to the base Debian/KDE install.
mipadaitu@lemmy.world · 3 pts · 2y
Yeah, it's worth it to just start fresh. Keep your user data, nuke the rest and setup from scratch w/automation if it's extremely customized to your liking.
I personally try to use the default config as much as possible so there's not as much to set up after installing from ISO.
gencha@lemm.ee · 2 pts · 2y
There will always be gaps, but describing your machine through Ansible is worth it and can be fun if you're into that sort of thing.
The first time I set up a freshly installed Debian laptop from my existing Ansible roles was a really enjoyable moment.
Being able to establish a familiar base on a fresh system at will is a far greater power than pure config/data backups.
xordos@lonestarlemmy.mooo.com · 1 pts · 2y
You mentioned rsync, then take a look rsnapshot if you haven't yet. It is based on rsync and doing incremental backup very well.
bizdelnick@lemmy.ml · 1 pts · 2y
What kind of changes? Package installation, removal and configuration? Use
apt-mark showmanualto save list of manually installed packages,dpkg --get-selections | grep 'deinstall$'to save list of removed packages,debconf --get-selectionsto save debconf package settings, backup files that you edited in/etc. This should be enough for restoration, wouldn't take a long time for backup and avoid risk of filesystem inconsistency.waspentalive@lemmy.ml · 1 pts · 1y
Installing specific things both from the repo and from elsewhere (Minecraft), Minor UI tweaks - move the panel to the left side (wide monitor), Konsole settings for colors, font(dotted zero), font size (bigger), 80x25 window. Probably others but that's all I remember for now.
bizdelnick@lemmy.ml · 1 pts · 1y
User settings are stored in the home directory, so you already have them backed up with rsync. If you didn't omit dotfiles, of course.
bjoern_tantau@swg-empire.de · 4 pts · 2y
I back up /etc, whatever I need from /var and
dpkg --get-selections.everett@lemmy.ml · 4 pts · 2y
Ignoring the whole debate about whether to include system files in your backup,
rdiff-backupsounds a lot like what you want. It stores your latest backup as plain files on-disk just like rsync, checks the box for incremental backups (older versions of files are stored as diffs, which you can easily browse withrdiff-backup-fs) and isn't much different to use than rsync. That said, people will point out that you can make rsync do pretty much the same stuff using hard linking.lemmyreader@lemmy.ml · 3 pts · 2y
peasntanks@lemmy.ml · 2 pts · 2y
Relax And Recover for os level backups. https://relax-and-recover.org/
With rear you can back up your system to pretty much anything. Mounted volume, USB drive, even to a bootable iso.
I use weekly rear backups for my system, and hourly Borg backups for diffs/point in time restore of user data, but you could use rear for an entire system snapshot as well.
data1701d@startrek.website · 1 pts · 2y
I would say dd is the best solution for a very complete backup, but I’m also a fan of Borg Backup for incremental backups.
frizop@lemmy.world · 1 pts · 2y
no calls for restic? I use restic and a s3 layer on the other end, be it either backblaze/wasabi/s3/whatever for remote or minio/garage for local object storage. Stuff just works, then I write a systemd unit file to back it up according to whatever schedule I want for both a local target and a remote target. Helps to solve the 3-2-1 backup strategy this way. Good luck!
AnnaFrankfurter@lemmy.ml · -5 pts · 2y
dd if=/dev/sda of=/dev/sdb bs=5M --status=progress
Just don't mix up a and b otherwise you're truly screwed.
waspentalive@lemmy.ml · 2 pts · 2y
I actually did this **dd if=(running system root volume) of=(local usb attached hard drive file) ** This gives me a full disk backup that would be no worse than if power got yanked. (I know laptops have batteries, for this case we are pretending to be a desktop with no UPS)