restic: Symlinks to a directory are not detected in Windows

Output of restic version

restic 0.7.0
compiled with go1.8.3 on windows/amd64

How did you start restic exactly? (Include the complete command line)

restic backup --repo R:\test_backup R:\test

What backend/server/service did you use?

Local.

Expected behavior

The symlink to a directory should be detected just like symlinks to files are.

Actual behavior

warning for test\symlinkdir: invalid node type ""

Steps to reproduce the behavior

restic init --repo R:\test_backup
restic backup --repo R:\test_backup R:\test

R:\test contains a directory called realdir and a symlink to it called symlinkdir created with mklink /D symlinkdir realdir (you’ll need an elevated prompt in order to do that). A junction to the directory (mklink /J) behaves the same way (what’s the difference? see end of page 431).

Do you have any idea what may have caused this?

Somehow nodeTypeFromFileInfo() is returning "" for a symlink to a directory. It might be a bug in the os package and this is more like an upstream thing?

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 19 (6 by maintainers)

Most upvoted comments

Hi, guys. Got the same problem with symlinks for folders and files with restic 0.9.6 on windows 7, sp1. Symlinks(hardlinks and junction) don’t appear in recovery folder after snapshot is extracted, they are missed or skipped by restic. May be, is there a solution for that problem? Thanks in advance.

I just ran across this issue in version 0.12.1 with a junction to a local drive. I lost an important file, tried restoring it only to discover that it was never backed up in the first place 😠 I spent hours debugging why only to figure out that no junctions are backed up.

So… Can we please have a workaround for this issue and increase its priority?

PS: I cannot simply convert the junction to a normal directory because the directory in question is very large and resides on a completely different drive.