Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve symbolic links on local storage #29915

Open
EsmailELBoBDev2 opened this issue Nov 25, 2021 · 2 comments
Open

Preserve symbolic links on local storage #29915

EsmailELBoBDev2 opened this issue Nov 25, 2021 · 2 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement feature: external storage feature: filesystem hotspot: filename handling Filenames - invalid, portable, blacklisting, etc.

Comments

@EsmailELBoBDev2
Copy link

How to use GitHub

  • Please use the 👍 reaction to show that you are interested into the same feature.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Is your feature request related to a problem? Please describe.
I'm always frustrated when i try backing up symlinks using docker-compose exec --user www-data app php occ files:scan --all because it go to location of file and scan it instead of uploading the symlink as is (text file with location of real location?)

Describe the solution you'd like
treat symlinks as textfiles maybe and upload them?

Describe alternatives you've considered
I enabled backup up links in my config.php ('localstorage.allowsymlinks' => true,)

Additional context
My use case is backing up my files (including .wine dir which uses sym links in z:\ that leads to my root dir)

@EsmailELBoBDev2 EsmailELBoBDev2 added 0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement labels Nov 25, 2021
@EsmailELBoBDev2 EsmailELBoBDev2 changed the title Treat symoblic links as files #29910 Treat symoblic links as files Nov 25, 2021
@joshtrichards
Copy link
Member

treat symlinks as textfiles maybe and upload them?
[...]
My use case is backing up my files (including .wine dir which uses sym links in z:\ that leads to my root dir)

Are you referring to uploading symbolic links that exist on the client side and maintaining them as symbolic links within NC?

I'm always frustrated when i try backing up symlinks using docker-compose exec --user www-data app php occ files:scan --all because it go to location of file and scan it instead of uploading the symlink as is (text file with location of real location?)
[...]
My use case is backing up my files (including .wine dir which uses sym links in z:\ that leads to my root dir)

Note that Nextcloud isn't a backup solution. Syncing the target of a symbolic link as a file (as it currently functions), sure. But client-device symbolic links aren't really a concept that can be mapped from another device. The "real location" only exists on your original device. For relative symbolic links, where all the targets are also hosted within your sync'd folders, maybe I can see that. But any targets of symbolic links outside the already sync'd folders would just be inaccessible from any other device (including the NC Server).

@joshtrichards joshtrichards changed the title Treat symoblic links as files Preserve symbolic links Aug 27, 2023
@f1d094
Copy link

f1d094 commented Mar 10, 2024

@joshtrichards Syncing the target of a symbolic link as a file is absolutely the incorrect approach for symbolic links. They should be copied as-is, unmolested. The current behavior is destructive, unexpected behavior that interferes with the normal function of the FS and OS on all *nix operating systems. Nextcloud should not be replacing 0byte items with duplicate files.

With proper, un-molested implementation of symlinks, inter-operating system compatibility should not be an issue. For any client-OS that does not support symlinks, the client should simply ignore them. Server-side, they could be special files that simply describe where they normally point allowing for server-side deletion if desired, but no creation or modification.

When they are server-side or sync'd to another client, it should not matter if they are "broken" and point to nothing. This is common and expected by the end user. Whether or not symlinks can be mapped from another system is also irrelevant. It is up the end-user to have similar file-systems on the various sync'd clients if they want those symlinks to work...or not. It is not Nextcloud's place to be making that decision on the user's behalf, making unexpected changes to file or the filesystem.

There are two PRs on this now to restore correct behavior of symlinks. PR#41321 and PR#6205

@joshtrichards joshtrichards changed the title Preserve symbolic links Preserve symbolic links on local storage May 1, 2024
@joshtrichards joshtrichards added the hotspot: filename handling Filenames - invalid, portable, blacklisting, etc. label Sep 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement feature: external storage feature: filesystem hotspot: filename handling Filenames - invalid, portable, blacklisting, etc.
Projects
None yet
Development

No branches or pull requests

3 participants