How to sync "symbolic links" in linux?

Get help for specific problems
Posts: 4
Joined: 9 Sep 2020

CRD

Hi there!

I've just installed FFS and it seems really great. However, I'm trying to sync two linux machines and I cannot find, for my life, a way to sync symbolic links (which I want to be identical in both machines). I always get the error message "Operation not supported between different devices."

I've ticked "Direct" in "Include symbolic links" in the Synchronizing Settings.

Can someone, please, advice? Many thanks!
User avatar
Site Admin
Posts: 7211
Joined: 9 Dec 2007

Zenju

What is the full error message?
Posts: 4
Joined: 9 Sep 2020

CRD

Hi Zenju,

The full message is:


Cannot copy symbolic link "sftp://server/folder/link" to "/folder/link".

Operation not supported between different devices.



Any ideas?
Posts: 4
Joined: 9 Sep 2020

CRD

More details, in case it helps: I'm using FreeFileSync 11.1 on Linux Mint 20 Cinnamon...
User avatar
Site Admin
Posts: 7211
Joined: 9 Dec 2007

Zenju

FreeFileSync should support this. => ToDo
Posts: 4
Joined: 9 Sep 2020

CRD

Thank you , Zenju!

Just for reference, in case some one else is in the same situation, I'm syncing the symbolic links in the meanwhile using rsync:

rsync -avzu -e ssh "remotehost:/path/remotesymlink" "/path/localsynmlink"

(see rsync man page for details...)
Posts: 2
Joined: 13 Jan 2021

ryoushi86

Hello,

Any update about this issue? I'm trying to copy symbolic links between 2 devices and the error message is :
Info : Creating symbolic link "/mnt/whatever"
Error : Cannot copy symbolink link
"sftp://mnt/whatever to /mnt/whatever".
Operation not supported between different devices.

I'm using FreeFileSync 11.5 on Debian 10 with "Direct" box ticked

Thank you for your wonderfull software !
Posts: 49
Joined: 7 Nov 2020

mdrmdr

I second this request to be able to sync symbolic links from (in my case) Linux to Windows. A Linux symbolic link should result at Windows in the file the link is pointing to.

Thanks a lot!
User avatar
Site Admin
Posts: 7211
Joined: 9 Dec 2007

Zenju

I second this request to be able to sync symbolic links from (in my case) Linux to Windows. A Linux symbolic link should result at Windows in the file the link is pointing to. mdrmdr, 15 Jan 2021, 11:17
This should already work. See "Symbolic Link Handling": https://freefilesync.org/manual.php?topic=comparison-settings
Posts: 49
Joined: 7 Nov 2020

mdrmdr

Unfortunately not. I get "Operation not supported between different devices." I included symbolic links as "direct". I use FFS 11.5 on Windows and access Linux via ftp.
User avatar
Site Admin
Posts: 7211
Joined: 9 Dec 2007

Zenju

Unfortunately not. I get "Operation not supported between different devices." I included symbolic links as "direct". mdrmdr, 15 Jan 2021, 12:25
So this is also SFTP => Windows?
Posts: 49
Joined: 7 Nov 2020

mdrmdr

Not SFTP, standard FTP.
User avatar
Site Admin
Posts: 7211
Joined: 9 Dec 2007

Zenju

You need to set symlink handling to "follow".
Posts: 49
Joined: 7 Nov 2020

mdrmdr

No success. Then I get many errors like
CURLE_FTP_COULDNT_RETR_FILE: RETR response: 550
550 '/opt/automation/config_links/000-default-ssl.conf' is not a directory [curl_easy_perform]
Posts: 2
Joined: 13 Jan 2021

ryoushi86

Syncing symbolic links between 2 linux boxes would be very nice :)
Posts: 49
Joined: 7 Nov 2020

mdrmdr

FileZilla also shows the 550 error:
Command: CWD 000-default-le-ssl.conf
Answer: 550 000-default-le-ssl.conf: Not a directory
But then it does not stop and just copies the linked file....
User avatar
Site Admin
Posts: 7211
Joined: 9 Dec 2007

Zenju

FileZilla also shows the 550 error:
Command: CWD 000-default-le-ssl.conf
Answer: 550 000-default-le-ssl.conf: Not a directory
But then it does not stop and just copies the linked file.... mdrmdr, 15 Jan 2021, 12:51
Indeed. The FTP protocol is very limited compared to SFTP regarding symlinks but FreeFileSync might be able to do something about this => ToDo
Posts: 49
Joined: 7 Nov 2020

mdrmdr

:-)
User avatar
Site Admin
Posts: 7211
Joined: 9 Dec 2007

Zenju

The FTP protocol is very limited compared to SFTP regarding symlinks but FreeFileSync might be able to do something about this => ToDo Zenju, 15 Jan 2021, 16:06
Implemented! FreeFileSync now handles symbolic links pointing to files via FTP (before it only supported links pointing to directories)
https://www.mediafire.com/file/o9m2m2y0c61al7w/FreeFileSync_11.6_%255BBeta%255D_Windows_Setup%25284%2529.exe
Posts: 49
Joined: 7 Nov 2020

mdrmdr

Installed 11.6 Beta and still the same error "Operation not supported between different devices". German error message attached.
Attachments
FFS.jpg
FFS.jpg (38.68 KiB) Viewed 3661 times
User avatar
Site Admin
Posts: 7211
Joined: 9 Dec 2007

Zenju

You still need to set symlink handling to "follow".
Posts: 49
Joined: 7 Nov 2020

mdrmdr

If I set it to "follow", I get this error for each linked file:
Attachments
FFS2.jpg
FFS2.jpg (40.9 KiB) Viewed 3657 times
Posts: 49
Joined: 7 Nov 2020

mdrmdr

In the affected directory on my Raspberry, I have links to files and directories. I'd like to only sync the linked files, not the directories. Excluding the directories still gives the above error.

Actually I would expect the following behaviour:
• "direct": sync linked files and ignore linked directories
• "follow": sync the whole tree of a linked directory (possibly with a "depth" parameter?) and sync linked files

Therefore I'd prefer "direct" with the above behaviour or "follow" with "depth=0"
User avatar
Site Admin
Posts: 7211
Joined: 9 Dec 2007

Zenju

If I set it to "follow", I get this error for each linked file: mdrmdr, 16 Jan 2021, 13:06
It seems "fullchain.pem" is incorrectly considered a directory. Here's a debug version of FreeFileSync, which error details do you get?
https://www.mediafire.com/file/t7mj94453u3zbs5/FreeFileSync_11.6_%255BBeta%255D_Windows_Setup%25285%2529.exe
Posts: 49
Joined: 7 Nov 2020

mdrmdr

Same "is not a directory" error during "compare" as before for any linked file with "follow". No further details. Where should I see more details?
User avatar
Site Admin
Posts: 7211
Joined: 9 Dec 2007

Zenju

Did you run the same test case? I've added code if the item name is "fullchain.pem" and FreeFileSync will show a different error message. Also check you're really running the correct beta and not some other version.
Posts: 49
Joined: 7 Nov 2020

mdrmdr

Now, the only link to be synced is:
cert -> /etc/letsencrypt/live/dyn.xxx.de/ (link)

Within "/etc/letsencrypt/live/dyn.xxx.de/":
fullchain.pem -> ../../archive/dyn.xxx.de/fullchain450.pem (file)

This gives:
FFS3.jpg
FFS3.jpg (43.07 KiB) Viewed 3649 times

If (for debugging only):
cert -> fullchain.pem (file)

it works and FFS syncs the the path "cert -> fullchain.pem"
So it seems that FFS only is able to follow 1 level?

if (for debugging only):
fullchain.pem -> /etc/letsencrypt/live/dyn.xxx.de/fullchain.pem (file)
I get:
FFS4.jpg
FFS4.jpg (31.54 KiB) Viewed 3649 times
Posts: 49
Joined: 7 Nov 2020

mdrmdr

Upate: Now the attachments of the above post are correct...
--
(There seems to be an attachment inlining problem at your board. The second picture after "I get" should be
FFS4 not FFS3 again...)
Posts: 49
Joined: 7 Nov 2020

mdrmdr

But again: My standard case is to follow links down just by one level to exactly one file. If a link points to a directory, the danger under Linux is, that a huge tree is affected. Therefore I'd exclude links to directories and only let FFS sync links which directly points to a file. For the above debugging example, I had to move some files out of "/etc/letsencrypt/live/dyn.xxx.de" so that FFS only finds "fullchain.pem".
User avatar
Site Admin
Posts: 7211
Joined: 9 Dec 2007

Zenju

Now, the only link to be synced is:
cert -> /etc/letsencrypt/live/dyn.xxx.de/ (link)

Within "/etc/letsencrypt/live/dyn.xxx.de/":
fullchain.pem -> ../../archive/dyn.xxx.de/fullchain450.pem (file)

This gives: [SIZE: 550] mdrmdr, 16 Jan 2021, 14:49
This is either:
1. an issue with the FTP server: it cannot find the file at /opt/automation/config_links/cert/fullchain.pem although it should, or...
2. /opt/automation/config_links/cert/fullchain.pem is a broken symlink

If (for debugging only):
cert -> fullchain.pem (file)

it works and FFS syncs the the path "cert -> fullchain.pem"
So it seems that FFS only is able to follow 1 level? mdrmdr, 16 Jan 2021, 14:49
This is FFS's new file-symlink support => okay

if (for debugging only):
fullchain.pem -> /etc/letsencrypt/live/dyn.xxx.de/fullchain.pem (file)
I get: [SIZE: 213] mdrmdr, 16 Jan 2021, 14:49
This is also FFS's new file-symlink support => okay
(the error message only comes up because it is the debug version)