--sftp-skip-links and junction points

What is the problem you are having with rclone?

--sftp-skip-links ignores symbolic links on a macOS remote, as expected.

However, it does not ignore junction points on a Windows remote. Is this the correct behavior?

Run the command 'rclone version' and share the full output of the command.

rclone v1.68.0

  • os/version: debian 12.4 (64 bit)
  • os/kernel: 6.6.32-production+truenas (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.23.1
  • go/linking: static
  • go/tags: none

Which cloud storage system are you using? (eg Google Drive)

SFTP

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone lsd windows_TEST-PC: --sftp-skip-links

That will depend on how the sftp server is identifying the links to rclone.

Here is how the SFTP backend identifies links - as non regular files.

		// If file is a symlink (not a regular file is the best cross platform test we can do), do a stat to
		// pick up the size and type of the destination, instead of the size and type of the symlink.
		if !info.Mode().IsRegular() && !info.IsDir() {
			if f.opt.SkipLinks {
				// skip non regular file if SkipLinks is set
				continue
			}

So I would guess that the windows sftp server is identifying these as regular files.

Or are they pointing at directories?

Which sftp server is this? Have you tried rclone serve sftp on Windows?

Hi ncw, thanks for your reply, and also for such a complete and powerful program.

It is sftp-server.exe, installed by OpenSSH Server as 'optional feature' in Windows 10. I have not yet tried with rclone serve ftp.

Surely, the problem is the one you say. While it would be nice to correctly identify the junction points, I guess there is nothing to do if the server identifies them as regular files!

Yes, they are junction points pointing to directories. Specifically, all the ones that Windows creates by default on all users, such as:

C:/Users/username/Application Data
C:/Users/username/Documents/My Music
C:/Users/username/Documents/My Pictures
C:/Users/username/Documents/My Videos
C:/Users/username/Cookies
C:/Users/username/Local Settings
C:/Users/username/My Documents
C:/Users/username/NetHood
C:/Users/username/PrintHood
C:/Users/username/Recent
C:/Users/username/SendTo
C:/Users/username/Start Menu
C:/Users/username/Templates

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.