-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Option to follow symlinks _in path arguments_ #2564
Description
Output of restic version
restic 0.9.6 compiled with go1.13.4 on linux/amd64
What should restic do differently? Which functionality do you think we should add?
I would very much like for restic to have an option to follow symlinks solely within the paths passed to restic.
(This resembles #2211, but it is nearly unrelated. And it overlaps with #542, but this request is focused in a way that issue is not; if I should've posted this in there, please let me know.)
Right now, if I do...
$ restic backup /path/to/a/symlink_to_a_dir
or
$ restic backup /path/to/a/symlink_to_a_file
...I get a snapshot containing a single symlink, which makes sense.
I would greatly value being able to do something along these lines...
$ restic --follow-arg-symlinks backup /path/to/a/symlink_to_a_dir
...and get a snapshot named with the path "/path/to/a/symlink_to_a_dir" but with the contents of /path/to/the/real_symlinked_dir
The concept is very much like this find option:
-H Do not follow symbolic links, except while processing the command line arguments.
What are you trying to do?
To be clear, this isn't at all about following symlinks within a backup fileset (I grasp why that's a big can of worms); this is solely about optionally following symlinks to find to the root of the backup fileset.
One of my use cases is that I use urbackup to archive some local clients to the server I'm backing up with restic, and it manages its backup "snapshots" over time as new folders containing both changed files and hardlinks to unchanged files, and always keeps a current symlink pointing to the latest backup.
Since I'm only interested in backing up that current backup, it would be valuable to be able to simply point restic to it with a --follow-arg-symlinks (or similar) option.
Right now, I'm scripting my way around that, but the downside is that each new restic backup is a snapshot named with a different path; what I want is simply a series of snapshots named with the /path/to/urbackup/client/symlink_to_current path, but with the contents of the directory referenced by the symlink.
Did restic help you today? Did it make you happy in any way?
restic helps me nearly every day. There are a few rough edges yet to file down and things I pray it will someday be able to do, but I depend on it regularly. I'm pleased and very thankful.