Cannot make --links option work

What is the problem you are having with rclone?

Trying to sync or copy linux filesystem including symlink, with preserving those using --link option. But cannot make it work.

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

rclone v1.65.1

  • os/version: debian 12.4 (64 bit)
  • os/kernel: 6.1.0-17-amd64 (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.21.5
  • go/linking: static
  • go/tags: none
    rclone copy /mnt/backup/backups/last-backup backups-encrypted:last-backup --links -vv
    2024/01/23 13:45:43 DEBUG : rclone: Version "v1.65.1" starting with parameters ["rclone" "copy" "/mnt/backup/backups/last-backup" "backups-encrypted:last-backup" "--links" "-vv"]
    2024/01/23 13:45:43 DEBUG : Creating backend with remote "/mnt/backup/backups/last-backup"
    Enter configuration password:
    password:
    2024/01/23 13:45:49 DEBUG : Using config file from "/root/.config/rclone/rclone.conf"
    2024/01/23 13:45:49 DEBUG : local: detected overridden config - adding "{b6816}" suffix to name
    2024/01/23 13:45:49 Failed to create file system for "/mnt/backup/backups/last-backup": need ".rclonelink" suffix to refer to symlink when using -l/--links

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

ssh/sftp

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

rclone copy /mnt/backup/backups/last-backup backups-encrypted:last-backup --links

Enter configuration password:
password:
2024/01/23 13:44:08 Failed to create file system for "/mnt/backup/backups/last-backup": need ".rclonelink" suffix to refer to symlink when using -l/--links

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

[backups]
type = sftp
host = XXX
user = XXX
shell_type = unix
md5sum_command = md5 -r
sha1sum_command = sha1 -r

[backups-encrypted]
type = crypt
remote = backups:encrypted
password = XXX
password2 = XXX

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

rclone copy /mnt/backup/backups/last-backup backups-encrypted:last-backup --links -vv
2024/01/23 13:45:43 DEBUG : rclone: Version "v1.65.1" starting with parameters ["rclone" "copy" "/mnt/backup/backups/last-backup" "backups-encrypted:last-backup" "--links" "-vv"]

2024/01/23 13:45:43 DEBUG : Creating backend with remote "/mnt/backup/backups/last-backup"
Enter configuration password:
password:
2024/01/23 13:45:49 DEBUG : Using config file from "/root/.config/rclone/rclone.conf"
2024/01/23 13:45:49 DEBUG : local: detected overridden config - adding "{b6816}" suffix to name
2024/01/23 13:45:49 Failed to create file system for "/mnt/backup/backups/last-backup": need ".rclonelink" suffix to refer to symlink when using -l/--links

Thanks in advance for any help..

One more note: tried the same also with not encrypted remote, and got the same error - so the encryption seems not related.

It is probably link itself - correct? in order to follow it you have to provide --copy-links instead of --links flag

Otherwise make sure that you copy from directory and not from link to directory

Yes that seems to be the trouble, thanks a lot :slight_smile:

When using the dir to which latest-backup was pointing as src instead of the symlink, it seems working.

1 Like

Bash tip:

You can always use program called readlink in your command or script in situation like this, e.g.:

$ rclone copy \
`readlink -f /mnt/backup/backups/last-backup` \
backups-encrypted:last-backup \
--links -vv

For more details:

$ man readlink

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