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

Symlinks aren't followed #45

Open
IslandC0der opened this issue Apr 17, 2020 · 4 comments
Open

Symlinks aren't followed #45

IslandC0der opened this issue Apr 17, 2020 · 4 comments

Comments

@IslandC0der
Copy link

IslandC0der commented Apr 17, 2020

I have a directory with a lot of symlinks (both files and dirs), and, when I sync it, the expected behavior would be for the actual file or directory to be synced, not the symlink itself. rsync has the -L flag which does exactly this, so I hope this wouldn't be too hard to implement:
In the same way that bsync has the -o flag to pass arguments to ssh, I propose for there to be a similar flag that allows us to pass custom arguments to rsync. However, this would require some further changes: for instance, to the code that generates the .bsync-snap to account for when we want to follow symlinks (pass the -L flag to find).
However, I also had to edit the flags that are currently passed to rsync by default, namely -a which conflicts with -L. According to man rsync, -a is the same as -rlptgoD, so I just changed -a to -rLptgoD to test, and the rsync part worked.

@dooblem
Copy link
Owner

dooblem commented Apr 21, 2020

Thanks for your feedbak/idea.

There are more things to consider:

  • how do we handle circular symlinks
  • do we need additionnal checks when symlinks to another filesystem type (permissions/modification date) may be different.

I would be glad to test if you have a working patched version.

@IslandC0der
Copy link
Author

Done, just sent a pull request. It would be nice to maybe add it as an option instead of hard-coding it.
That said, I can't think of many cases where you'd want to copy the symlink itself instead of the file it actually points to, but let me know what you think.

@IslandC0der
Copy link
Author

Also, regarding circular symlinks: find already detects them, and it will output an error, which will cause bsync to abort due to a "Find error".

@sdelanoue
Copy link

Hi, please also consider that current behaviour is in most case more relevant
ie. in my case I save the .wine directory witch have a sub-directory "game" that is a link to a directory on a SSD
I don't want this simlink to be transformed to a regular directory or it content to be copied
I rather have to issue 2 bsync command : 1 for .wine and 1 for the directory "game" on the SSD
witch is exactly the current behaviour

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants