Setting --backup-dir to a different drive than remote fails: "Move Rename failed"

What is the problem you are having with rclone?

Setting the --backup-dir flag to a different physical drive than the destination remote fails with a "Move Rename failed" error.

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

$ rclone version
rclone v1.69.0

  • os/version: ubuntu 24.04 (64 bit)
  • os/kernel: 4.4.0-19041-Microsoft (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.23.4
  • go/linking: static
  • go/tags: none

Same behaviour with v1.70.0-beta.8529.5316acd04

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

SFTP

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

On the SFTP remote, there are two physical drives mounted at /mnt/d and /mnt/f.
/mnt/d is the destination remote, while /mnt/f is intended to be the backup drive.
The following command fails:

rclone copy -vv --backup-dir nas:/mnt/f/a_dir /mnt/d/a_dir nas:/mnt/d/a_dir

Setting the backup-dir on the same physical drive does not produce an error and file is moved to backup-dir:

rclone copy -vv --backup-dir nas:/mnt/d/another_dir /mnt/d/a_dir nas:/mnt/d/a_dir

Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.

$ rclone config redacted
[nas]
type = sftp
host = XXX
user = XXX
port = XXX
key_file = /home/*username*/.ssh/id_ed25519
md5sum_command = md5sum
sha1sum_command = sha1sum
shell_type = unix

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

Initialisation of the remote:

echo 'foobar' > a_file
$ rclone copy -v /mnt/d/a_dir nas:/mnt/d/a_dir
2025/01/15 21:16:34 INFO  : a_file: Copied (new)
2025/01/15 21:16:34 INFO  :
Transferred:              7 B / 7 B, 100%, 0 B/s, ETA -
Transferred:            1 / 1, 100%
Elapsed time:         0.4s

Update of the remote:

echo 'foobar' >> a_file
$ rclone copy -vv --backup-dir nas:/mnt/f/a_dir /mnt/d/a_dir nas:/mnt/d/a_dir
2025/01/15 20:48:06 DEBUG : rclone: Version "v1.69.0" starting with parameters ["rclone" "copy" "-vv" "--backup-dir" "nas:/mnt/f/a_dir" "/mnt/d/a_dir" "nas:/mnt/d/a_dir"]
2025/01/15 20:48:06 DEBUG : Creating backend with remote "/mnt/d/a_dir"
2025/01/15 20:48:06 DEBUG : Using config file from "/home/*user_name*/.config/rclone/rclone.conf"
2025/01/15 20:48:06 DEBUG : Creating backend with remote "nas:/mnt/d/a_dir"
2025/01/15 20:48:06 DEBUG : sftp://*domain_name*//mnt/d/a_dir: New connection *an_ip_adress*:*a_port*->*another_ip_adress*:*another_port* to "SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.11"
2025/01/15 20:48:07 DEBUG : sftp://*domain_name*//mnt/d/a_dir: Shell type "unix" from config
2025/01/15 20:48:07 DEBUG : sftp://*domain_name*//mnt/d/a_dir: Using root directory "/mnt/d/a_dir"
2025/01/15 20:48:07 DEBUG : Creating backend with remote "nas:/mnt/f/a_dir"
2025/01/15 20:48:07 DEBUG : sftp://*domain_name*//mnt/f/a_dir: New connection *an_ip_adress*:*a_port*->*another_ip_adress*:*another_port* to "SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.11"
2025/01/15 20:48:07 DEBUG : sftp://*domain_name*//mnt/f/a_dir: Shell type "unix" from config
2025/01/15 20:48:07 DEBUG : sftp://*domain_name*//mnt/f/a_dir: Using root directory "/mnt/f/a_dir"
2025/01/15 20:48:07 DEBUG : a_file: Sizes differ (src 14 vs dst 7)
2025/01/15 20:48:07 DEBUG : sftp://*domain_name*//mnt/d/a_dir: Waiting for checks to finish
2025/01/15 20:48:07 ERROR : a_file: Couldn't move: Move Rename failed: sftp: "Failure" (SSH_FX_FAILURE)
2025/01/15 20:48:07 DEBUG : sftp://*domain_name*//mnt/d/a_dir: Waiting for transfers to finish
2025/01/15 20:48:07 ERROR : Attempt 1/3 failed with 1 errors and: Move Rename failed: sftp: "Failure" (SSH_FX_FAILURE)
2025/01/15 20:48:07 DEBUG : sftp://*domain_name*//mnt/d/a_dir: Waiting for checks to finish
2025/01/15 20:48:07 DEBUG : a_file: Sizes differ (src 14 vs dst 7)
2025/01/15 20:48:07 ERROR : a_file: Couldn't move: Move Rename failed: sftp: "Failure" (SSH_FX_FAILURE)
2025/01/15 20:48:07 DEBUG : sftp://*domain_name*//mnt/d/a_dir: Waiting for transfers to finish
2025/01/15 20:48:07 ERROR : Attempt 2/3 failed with 1 errors and: Move Rename failed: sftp: "Failure" (SSH_FX_FAILURE)
2025/01/15 20:48:07 DEBUG : sftp://*domain_name*//mnt/d/a_dir: Waiting for checks to finish
2025/01/15 20:48:07 DEBUG : a_file: Sizes differ (src 14 vs dst 7)
2025/01/15 20:48:07 ERROR : a_file: Couldn't move: Move Rename failed: sftp: "Failure" (SSH_FX_FAILURE)
2025/01/15 20:48:07 DEBUG : sftp://*domain_name*//mnt/d/a_dir: Waiting for transfers to finish
2025/01/15 20:48:07 ERROR : Attempt 3/3 failed with 1 errors and: Move Rename failed: sftp: "Failure" (SSH_FX_FAILURE)
2025/01/15 20:48:07 INFO  :
Transferred:              0 B / 0 B, -, 0 B/s, ETA -
Errors:                 1 (retrying may help)
Checks:                 6 / 6, 100%
Elapsed time:         0.4s

2025/01/15 20:48:07 DEBUG : 22 go routines active
2025/01/15 20:48:07 DEBUG : sftp://*domain_name*//mnt/d/a_dir: Closing 1 unused connections
2025/01/15 20:48:07 DEBUG : sftp://*domain_name*//mnt/f/a_dir: Closing 1 unused connections
2025/01/15 20:48:07 NOTICE: Failed to copy: Move Rename failed: sftp: "Failure" (SSH_FX_FAILURE)

The documentation specifies that the backup-dir remote should be the same as the destination remote, which is the case. Is there more to it?
Is there any workaround you would suggest to get the same results?

As per docs:

The remote in use must support server-side move or copy and you must use the same remote as the destination of the sync.

server-side move/copy I think in this case does not work. Copy is out of the question as it can only be performed using hard links (sftp does not have copy command) and you have two different filesystems. But I wonder why move fails.

You'r right rclone move nas:/mnt/d/a_dir nas:/mnt/f/a_dir does not work in the first place

This leaves me confused: rclone move /mnt/d/a_dir /mnt/f/a_dir works when run from the NAS itself. Why does using two different filesystems does not work when run through SFTP?

I am not sure myself yet.

@asdffdsa any ideas?

hey, not sure what the issue is, no way to test that exact scenario.

  • check the debug log of the sftp server.
  • test another sftp tool
  • maybe try --sftp-copy-is-hardlink
  • maybe try rclone serve sftp
1 Like

Actually looking at this again I think that problem is with SFTP itself. Nothing to do with rclone.

There is no move operation in SFTP, only rename (can be used to simulate "rclone sftp move") which works only within the same filesystem.

So unless your SFTP server supports rename between different filesystems there is nothing rclone can do.

Maybe try different way to access your NAS. SMB? WebDAV? Or rethink how your two drives are used. Maybe better to combine them into mirror etc.

Thank you very much for your input!
I also figured I could run the rclone command from the Nas, seems the easiest for now.

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