0


I'm currently trying to figure out which directories I need if I want to download all data from my debian (9) server.
I already figured out that /dev and /proc along with /mnt don't contain any "real" files but stuff displayed as file (drives, processes, ...) but which other directories don't have real files in them?
Thank you!

1

There are a couple of directories which contain files (because everything in a Unix file system is a file), but those files are not something which can be practically archived and copied to another system:

  • /dev, which contains device special files and some pipes;
  • /proc, which contains Linux process and kernel information; and
  • /sys, which contains Linux kernel information.

There are other directories which you may not want to copy over, even though they do contain archivable contents:

  • /run and /var/run, which contain files that are used by programs that are presently running, but will be cleared on boot;
  • /tmp and /var/tmp, which are ephemeral temporary files;
  • /boot, which contains bootable materials that may be specific to this system; and
  • /media, which may contain additional drives which you may not (or may) want to archive.

I generally prefer to archive just /etc, /home, and /srv and not care very much about the rest. For example, I don't need to archive the contents of /usr because I can just download the Debian packages again.

You may also need to gracefully handle any sockets or FIFOs that get copied, since those can occasionally live under your home directory. Usually it's fine to ignore them and let them get recreated by programs that need them, though.

1
  • Thx, I want to be able to instandly deploy my server on another system, thats why I want EVERY file I can copy. But thanks, never thought about /var/tmp as a subdir! – BDevGW Apr 22 '20 at 21:02
0

A solution is to use df -T and only consider filesystems with types that you recognize (ext4, vfat...).

2
  • Don't think showing my file systems will show me that I need /home but not /proc... – BDevGW Apr 22 '20 at 20:56
  • Typically other FS types arent't useful (tmpfs, loop, squashfs...), they are either non-file, or built on something which is already a file. – xenoid Apr 22 '20 at 20:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.