and $FILE is a regular file in the backup of $HOST then restic restores it just fine, however if $FILE is a symlink then nothing gets restored.
Is that the intended behaviour?
I would have expected that I would get a dangling (as I only restored the symlink but not it’s target) symlink, and I am bit surprised that I don’t get any error but also no data…
Symlinks are archived as symlinks, restic does not follow them. When you restore, you get the same symlink again, with the same link target and the same timestamps.
Interesting. I just tried it myself - I backed up a directory which contained some files and a symlink. I then restored that symlink alone with restic restore --target test --verify --include foo/Apa.Ape latest, and it sure is restored as expected:
% ls -la test/foo
total 0
drwxr-xr-x 3 rawtaz staff 96 20 Mar 22:09 .
drwxr-xr-x 3 rawtaz staff 96 20 Mar 22:11 ..
lrwxr-xr-x 1 rawtaz staff 94 20 Mar 22:11 Apa.Ape -> rare/RARE FLAC/Unreleased and rare tracks/Another Suitcase In Another Hall (Tv Radio Edit).Ape
My best guess off the bat is that you are not supplying the correct path to the symlink you are trying to restore. Can you tell us how you back it up and what the path to it in the directory you back up is?
Of course, it could also be a matter of $FILE not containing what you think