Hello there! Here’s the thing: I got some old HDD for my Debian home server, and now that I have plenty of disk space I want to keep a backup of the OS, so that if something accidentally breaks (either SW or HW) I can quickly fix it.
now the question is: which directory should I include and which should I exclude from the backup? I use docker a lot, is there any docker-specific directory that I should back up?
Why? I have a hard time imagine a use case where restoring the OS itself would be appropriate.
I can imagine restoring data, obviously, and services running with their personalization … but the OS is something generic that should be discarded at whim IMHO. You probably chance few basic configuration of some services and most likely that’s stored in
/etc
but even then 99% is default.You can identify what you modified via shell history, e.g.
history | grep /etc
and potentially save them or you can also usefind /etc -type f -newerXY
with a date later than the OS installation and you should find what you modified. That’s probably just a few files.If you do back up anything beyond
/home
(which should be on another partition or even disk than the OS anyway) you’ll most likely save garbage like/dev
that might actually hinder your ability to restore.So… sure, image the OS if you actually have a good reason for it but unless you work on archiving and restoring legacy hardware for a museum then I doubt you do need that.