How to know which directories and files (not) to back up?

Hello fellow users of Fedora,

With a clean install of F36 KDE, I’m trying to figure out which directories and files I certainly do (not) have to backup. Although the post of @vgaetera in Backup strategy? my .local/ is 30Go ; my .config/ has cache data, my ~/.* is a mess was very helpful, that is not my desktop, but Vgaetera’s . Therefore I would like to learn wich kind/type of directories and files should I (no) back up, so that I can both apply this thought to my own case, and learn what all these folders are.

I’ve posted my back up strategy in Recommendations for desktop backup application - #3 by a86ul

For both Rsync and Vorta, I have /home/[$user] ‘ruled in’, so that every new account will be included in the backup. However, all the hidden stuff will be backup as well. Therefore I would like to learn which kind/type of directories and files should I (not) back up. So that I can apply your suggestions to my own case.

In other words, I have a back up strategy, but now the directories and the files, which?

First exclude the obvious things that are up to you. For example, do you want to backup Downloads and Videos? Maybe or maybe not depending on what you keep in those directories.

Barring obvious data you may want specifically exclude from your backups, my opinion is you should back up everything in /home except cache data. The problem is that there is no universal method of identifying cache data. It can be anywhere and in any directory.

For me, I exclude ~/.cache from my snapshots and don’t worry about anything else unless I see something that is objectively large.

For backups, I take the opposite approach. I only backup the things I explicitly want. I actually don’t backup my dotfiles. I have them in my snapshots if I want a recent version. If I have a disaster sufficient to require me to go to recover from an offsite backup, I am not going to be overly worried about my dotfiles. I can recreate them easily enough. Likewise, if I needed to go back in time farther than my snapshots reach, the dotfiles are again not much value to me.

Lastly, you should consider if there is anything you don’t want in your backups for security reasons. For example, I don’t include ssh or pgp keys in my normal backups. I have other ways of backing those up securely on the rare occasions they change.

5 Likes

These kind of directories are indeed quit obvious. However, sometimes it can be handy to explicit say these kind of obviousness. Sometimes they are to obvious…

The problem is that there is no universal method of identifying cache data. It can be anywhere and in any directory.

Thus cache is not always in ~/.cache? That is a quit funny behaviour, just like kids, they are all over the place.

For backups, I take the opposite approach. I only backup the things I explicitly want. I actually don’t backup my dotfiles. I have them in my snapshots if I want a recent version.

So, you’re not a data hoarder? Good to know. On this spectrum of hoarder vs you, I’m currently more leaning towards your approach:

  • Snapshot with btrbk every bit of data of this desktop:
  • Backup with both Vorta and Rsync for a fully working alternative desktop:
    – Vorta: include all hidden and visual directories of /home/[$user], but excludes ~/Downloads, ~/Build, and ~/.cache. Over time, I will exclude other directories too, when I get to know them better; just like fake friends.
    – Rsync: include only visual directories of /home/[$user], but not ~/Downloads and ~/Build. These included directories are my friends, I guess :wink:

Any how, it seems that backup is just like any social behaviour: kids, fake friends, what’s next? :wink:

1 Like