Copy symlink as symlink or at worst as .rclonelink

What is the problem you are having with rclone?

rclone duplicates fields as it follows symlink even with -l param

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

rclone v1.62.2

  • os/version: rocky 8.8 (64 bit)
  • os/kernel: 4.18.0-477.13.1.el8_8.x86_64 (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.20.2
  • go/linking: static
  • go/tags: none

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

both sides are Linux box

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

rclone -l sync dws:/web/shared/roundcube/ /data/tmp/roundcube/

The rclone config contents with secrets removed.

[dws]
type = sftp
host = 172.16.5.215
user = xxxxx
port = 2222
key_file = xxxxx/.ssh/id_rsa
md5sum_command = md5sum
sha1sum_command = sha1sum
shell_type = unix

Read the doc, find this post but :

dws:/web/shared/roundcube/public_html/plugins is a symlink ../plugins
after sync /data/tmp/roundcube/public_html/plugins is a directory containig all files

so source contains 2450 files and destination 4074.

I think it is by design. -l/-L flags only apply to local filesystem

on local filesystem:

$ rclone tree .
2023/06/21 17:35:38 NOTICE: link: Can't follow symlink without -L/--copy-links
/
└── test.txt

$ rclone tree . -L
/
├── link
│   ├── test1.txt
│   └── test2.txt
└── test.txt

rclone tree . -l
/
├── link.rclonelink
└── test.txt

the same folder over sftp:

$ rclone tree sftp:temp
/
├── link
│   ├── test1.txt
│   └── test2.txt
└── test.txt

$ rclone tree sftp:temp -l
/
├── link
│   ├── test1.txt
│   └── test2.txt
└── test.txt

 rclone tree sftp:temp -L
/
├── link
│   ├── test1.txt
│   └── test2.txt
└── test.txt

if you could push instead of pulling data you will get what you want. From local to sftp

In theory it could work with SFTP or FTP but it is not implemented at the moment.

PR to make it work definitely will be welcomed.

Thanks for quick answer @ kapitainsky...

Well due to several attacks I'am building a strong-box that can't be accessed by other nodes, so I prefer not to push from source to destination.

Thanks again.

Yeah - unfortunately it is the state of business as of today:) I think it comes from initial concept that cloud remotes do not have idea of link. Then SFTP/FTP was added but nobody thought about implementing these flags - as it is a bit of exception.

Maybe one day somebody can do it:)

One more comment - I think that right tool for the job here is rsync - linux box to linux box over ssh does not require "cloud" oriented program like rclone

I used to work with rsync and unison from a long time, and I discovered rclone recently as we plan to use S3 Object Storage in the future.

I found a feature of rclone very usefull => sync remote to local crypted...

So I was interested to use a unique tool for all my syncs.

Really great tool, don't know GO :smiling_face_with_tear:

1 Like

rsync IMHO is far superior to rclone for local jobs - with rclone these are not links you will lose over sftp - also many files attributes etc.

for cloud rclone is the best:)

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