But my question is not so fancy. I just want to use hard and/or symbolic links within my Nextcloud directories and have them synced as such to all other clients (and presumably stored as such on the server, too). Is this functionality supported? There is no mention of it in the documentation:
Use case: I have a lot of music in my NC and have put album art in each folder as cover.jpg and folder.jpg for compatibility with various media players. I can save space by hardlinking these filenames to the same image. In a quick test, I created such a hard link, and the image was synced correctly to my Nextcloud server, but it isn’t clear from the web interface whether NC “knows” that these are a hard link or it just pulled them up as two separate files.
There is no special handling for links (hard or soft nor, for that matter, their non-POSIX counterparts on some OSes). If the client syncs them, they’re completely independent files/folders.
If that’s the case, then using hard links at all is probably inadvisable, right?
Because you could hard link a.txt to b.txt on a client, then edit b.txt using the web interface, and now a.txt will change along with b.txt on the client side, and I don’t know what happens next—will NC detect that a.txt was changed (due to hardlinking) and update the server to match, or just be silently wrong?
Or if you edit a.txt and b.txt in two different ways using the web interface while the client that has the hard link is offline, then what happens when the client comes back online and tries to sync…
Nextcloud not only manages the files in the file system, but each file is also managed in the Nextcloud database.
Files changed via the file system are not recognised as changes by Nextcloud. In your case, the change to one file via Nextcloud will result in a file system change to the other file. Nextcloud will not notice this.
You can run the following command regularly. However, I advise against this.