-1

In this question, Accidentally deleted /usr/share a comment says that:

many user programs store application data there

Currently, I only back-up my /home directory tree; including hidden files and directories, since that is where I would expect configuration data to be stored.

Should I back up /usr/share also? I did ls -ltr /usr/share and was surprised to find sub-directories that had been modified recently, when I had not installed anything, or even used sudo. Sudo is important because I don't have write access to /usr/share directory.

Finally, are there any other similar directories that I should back up? (By similar, I mean being modified unexpectedly.)

closed as primarily opinion-based by Romeo Ninov, Kiwy, αғsнιη, Prvt_Yadav, Jeff Schaller May 1 at 13:15

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.

  • step0: do not execute any commands that you don't know the result. next step(s): backup your import data, all other data are always replaceable – αғsнιη Apr 30 at 11:40
1

System configuration data are stored in /etc and /var, generally. /usr/share holds package files. You are probably seeing recent modifications due to package upgrades.

If you expect to be able to recreate your system on another machine, you will want to start with the list of installed packages. You can get this with dpkg --get-selections (There are other methods, but this is simple. You simply save the output in a file and later you can pass it back to dpkg --set-selections. You lose information about which packages were automatically installed but at least you have a working system). These lists are stored in /var, but a text file is easier to back up than a potentially inconsistent database file.

/var/lib and /var/backups will also help you to recover your system.

Unless you have made local changes, most of /etc is provided by installed packages. You may want to back up /etc/passwd and /etc/shadow so that users can log in after recovery, but if you have to rebuild a single-user system from scratch this isn't important. /etc/default stores configuration data for installed packages.

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