Same directory multiple times in command-line harmful?

I am wondering if there is a problem when I add the same directory multiple times in a single backup command. In my case I don’t mean literally the same, but a top level directory and then one of its sub-directories, additionally. The reason behind this is that I want to create a command line that works on most of my computers.

Example:

restic backup --one-file-system / /boot /home

On most of my systems, /, /boot and /home are all on the same file system, so / would be sufficient. However, there are systems, where /boot and/or /home are separate file systems. It would be convenient to always have the same backup command in the scripts.

A quick test showed no problem. Did I miss something?

Should be fine. At least cannot think anything against it.

Nonexistent paths will be skipped, –one-file-system should stop probing in mounted folders, but this limitation is passed when you explicitly set the other FS’ mount path in the paths, thus restic will back up the “other” given filesystem.

One obvious caveat, which you shouldn’t care if you don’t have very exotic setup: If you had different files in e.g. /boot folder before mounting the real FS to /boot for some reason, these will not be backed up. But these will be effectively hidden anyway. :smile:

3 Likes