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?

  • linuxPIPEpower@discuss.tchncs.de
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    1 day ago

    It is a question I’ve spent a lot of time trying to work out. Can’t speak to docker.

    Some of the specifics of Keeps and Dontkeeps depend on details of your system. You have to find out where the distro, DM and other apps keep the following:

    Dontkeeps:

    • trashes
    • temp files
    • file indexes … IMHO these dont backup properly if you leave them in and will prevent you from completing the task
    • device files

    Keeps:

    • list of installed packages — explicit and deps separate if possible
    • config files: /etc, ~/.config, ~/.* on a case by case basis… I say remove the obvious large temp dirs and keep the rest by default for simplicity
      • for the system configs I’ve had a tool called etckeeper running for a while because it was highly recommended but I’ve never actually restored from it…
    • personal documents and other files such as typically kept in the home directory
    • /root occasionally has something you need

    Ways to investigate:

    • use a disk usage utility to find out where your storage is being used up … It’ll help you find large Dontkeeps
    • watch for recently modified files
    • dirs and files that are modified all the time are usually temp dirs. But sometimes they have something useful like your firefox profile.

    Most backup solutions are ONE of the following:

    1. User files
    2. System files

    Don’t spend too much time crying about needing two solutions. Just make your backup today and reach perfection later.

    Remember: sync isn’t backup. Test your backup if you can (but its not as easy as it sounds). Off site your most precious files.