Sync - How to use --sftp-path-override only for one of two SFTP remotes

What is the problem you are having with rclone?

I want to use two SFTP remotes to sync them.
One of the remote needs to use different root path ( via --sftp-path-override ) to be able to perform md5 checksums.
But it seems that --sftp-path-override will be applied two both remotes, effectively breaking checksums for the other remote ( that doesn't need the --sftp-path-override configuration ).

Is there a way to use --sftp-path-override only for one of the SFTP remotes ?

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

$ rclone version
rclone v1.68.2
- os/version: darwin 15.1.1 (64 bit)
- os/kernel: 24.1.0 (arm64)
- os/type: darwin
- os/arch: arm64 (ARMv8 compatible)
- go/version: go1.23.3
- go/linking: dynamic
- go/tags: none

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

SFTP on a synology NAS
SFTP on Hetzner Storagebox

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

rclone sync --check-first --exclude ".**" --sftp-path-override /volumeUSB1/usbshare/some/directory diskstation:/usbshare1/some/directory --storagebox:media/some/directory

Please run 'rclone config redacted' and share the full output.

[diskstation]
type = sftp
host = XXX
user = XXX
key_file = $HOME/.ssh/diskstation_ed25519
key_use_agent = true
shell_type = unix
md5sum_command = md5sum
sha1sum_command = sha1sum

[storagebox]
type = sftp
host = XXX
user = XXX
key_file = ~/.ssh/hetzner_ed25519
key_use_agent = true
port = 23
shell_type = unix
md5sum_command = md5 -r
sha1sum_command = sha1 -r

A log from the command that you were trying to run with the -vv flag

Not using the --sftp-path-override option causes md5 checksum on "diskstation" to fail, because paths don't exist ( at least not in the form rclone is trying ).
But remote "storagebox" works fine and it can checksum files.

Using the --sftp-path-override option flips the problem, now "diskstation" can checksum files, but remote "storagebox" fails to checksum because it is now using a wrong path ( root is correct for "diskstation" but not for "storagebox" ).

The only way to sync both remotes is by disabling the checksum feature entirely via --ignore-checksum --size-only.
Is there a way to use checksums in this scenario ?

What about instead of using these sftp servers directly access them using rclone serve? Could be sftp wrapper again. This way --sftp-path-override could apply only to one server. It is maybe not very elegant solution but I think it will work.

welcome to the forum,

if i understand what you want, i think these should work:

add path_override to the remote in the config file
or
use connection straings

Thank you for the hint, adding something like the following to one of the SFTP remote configs did the trick.

[my-remote]
....
path_override = /the/root

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