this post was submitted on 16 Jul 2025
61 points (98.4% liked)

Linux

56581 readers
428 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 6 years ago
MODERATORS
 

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?

you are viewing a single comment's thread
view the rest of the comments
[–] linuxPIPEpower@discuss.tchncs.de 2 points 5 days ago* (last edited 5 days 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.