Copyto --links doesn't work

What is the problem you are having with rclone?

I am trying to copyto a symlink. I thought at first that maybe it wasn't supported (since copy does work) but even the docs use a copyto example!

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

I tried on two systems.

rclone v1.62.0
- os/version: debian 11.6 (64 bit)
- os/kernel: 5.10.0-21-amd64 (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.20.2
- go/linking: static
- go/tags: none
rclone v1.62.0
- os/version: darwin 13.2.1 (64 bit)
- os/kernel: 22.3.0 (arm64)
- os/type: darwin
- os/arch: arm64 (ARMv8 compatible)
- go/version: go1.20.2
- go/linking: dynamic
- go/tags: cmount

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

Local-to-local and local-to-onedrive (to test

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

a/file1 is a symlink. I tried with a working link and a broken link, both relative and absolute.

local to local test:

rclone copyto --links a/file1 test.txt -vv

Local to onedrive test:

rclone copyto --links a/file1 onedrive:test.txt -vv

The rclone config contents with secrets removed.

I don't think it's a onedrive issue but... (Onedrive works otherwise

type = onedrive
token = {"access_token":"***","expiry":"2023-03-15T14:46:26.476859458Z"}
drive_id = ***
drive_type = personal
client_id = ***
client_secret = ***

A log from the command with the -vv flag

$ rclone copyto --links a/file1 onedrive:test.txt -vv
2023/03/15 13:49:12 DEBUG : rclone: Version "v1.62.0" starting with parameters ["rclone" "copyto" "--links" "a/file1" "onedrive:test.txt" "-vv"]
2023/03/15 13:49:12 DEBUG : Creating backend with remote "a/file1"
2023/03/15 13:49:12 DEBUG : Using config file from "/home/jwinokur/.config/rclone/rclone.conf"
2023/03/15 13:49:12 DEBUG : local: detected overridden config - adding "{b6816}" suffix to name
2023/03/15 13:49:12 DEBUG : fs cache: adding new entry for parent of "a/file1", "local{b6816}:/home/jwinokur/a"
2023/03/15 13:49:12 DEBUG : Creating backend with remote "onedrive:"
2023/03/15 13:49:13 ERROR : Attempt 1/3 failed with 1 errors and: object not found
2023/03/15 13:49:13 ERROR : Attempt 2/3 failed with 1 errors and: object not found
2023/03/15 13:49:13 ERROR : Attempt 3/3 failed with 1 errors and: object not found
2023/03/15 13:49:13 INFO  : 
Transferred:              0 B / 0 B, -, 0 B/s, ETA -
Errors:                 1 (retrying may help)
Elapsed time:         1.2s

2023/03/15 13:49:13 DEBUG : 3 go routines active
2023/03/15 13:49:13 Failed to copyto: object not found

$ rclone copyto --links a/file1 test.txt -vv
2023/03/15 13:49:52 DEBUG : rclone: Version "v1.62.0" starting with parameters ["rclone" "copyto" "--links" "a/file1" "test.txt" "-vv"]
2023/03/15 13:49:52 DEBUG : Creating backend with remote "a/file1"
2023/03/15 13:49:52 DEBUG : Using config file from "/home/jwinokur/.config/rclone/rclone.conf"
2023/03/15 13:49:52 DEBUG : local: detected overridden config - adding "{b6816}" suffix to name
2023/03/15 13:49:52 DEBUG : fs cache: adding new entry for parent of "a/file1", "local{b6816}:/home/jwinokur/a"
2023/03/15 13:49:52 DEBUG : Creating backend with remote "."
2023/03/15 13:49:52 DEBUG : local: detected overridden config - adding "{b6816}" suffix to name
2023/03/15 13:49:52 DEBUG : fs cache: renaming cache item "." to be canonical "local{b6816}:/home/jwinokur"
2023/03/15 13:49:52 ERROR : Attempt 1/3 failed with 1 errors and: object not found
2023/03/15 13:49:52 ERROR : Attempt 2/3 failed with 1 errors and: object not found
2023/03/15 13:49:52 ERROR : Attempt 3/3 failed with 1 errors and: object not found
2023/03/15 13:49:52 INFO  : 
Transferred:              0 B / 0 B, -, 0 B/s, ETA -
Errors:                 1 (retrying may help)
Elapsed time:         0.0s

2023/03/15 13:49:52 DEBUG : 2 go routines active
2023/03/15 13:49:52 Failed to copyto: object not found

Yes that appears not to work!

My feeling is you should probably be referring to the file as a/file1.rclonelink as that is what rclone knows it as if you do rclone lsf --links

However that doesn't work either.

I suspect this is a bug in the local backend with some confusion as to whether the file on the command line should have a .rclonelink suffix.

Note that files on the command line are treated differently so it might work with copy and not with copyto.

Yeah, I tried the added extension too.

Should I post this to GitHub? Do you expect it to be fixable?

Also, it does work with copy but for my use case, I need to change the names so I am using copyto. It’s a bit unfortunate in general since I take a performance hit but I’m using flags like no-check-dest since I know they don’t yet exists. I think that’s cutting down on it but I am still testing

Yes a good idea to post to GitHub so it doesn't get lost.

I'm sure it is fixable one way or another!

Done

In the mean time, I am diving head first into rc and rcd to speed up my other copyto transfers (I think on B2 I counted about 1/3rd the number of API calls not having to authorize for each). I will program around the symlink bug until it's fixed.

Thanks as always!

Thanks! Yes rc will help a lot with initial startup.

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