-
-
Notifications
You must be signed in to change notification settings - Fork 855
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
Ability to skip symbolic links? #87
Comments
I would be happy to contribute development to this myself, but I am unfamiliar with D. If you could point me to the source code which determines which files to sync I could try and add this myself. I had a quick search for "filter" and "skip" in the source code but couldn't find anything. Also, thank you for keeping this project alive! |
Thanks for the feature request. The simplest way to achieve this would be, in main.d add a new flag that can be used by sync.d, that if set, the symbolic link is skipped in Line 936 in sync.d currently checks to make sure a symbolic link is valid. What you could do before this iss check if your new flag is set to skip path if it is a symbolic link before the checks validating the path are done. Line 938 should also read |
PR #92 merged which implements this feature |
@abraunegg I just realised that I should really skip symlinked files when using the "monitor" command too. I was thinking of adding adding in similar checks on https://github.com/abraunegg/onedrive/blob/master/src/monitor.d#L65 and https://github.com/abraunegg/onedrive/blob/master/src/monitor.d#L166. What do you think? |
monitor.d essentially sets up all the inotify flags, however the main code where the changes were made is still run regardless of monitor mode or manual sync. By adding in changes to monitor.d, all that would happen would be no inotify watch be created on a symbolic link. In doing that there could be an 'incremental' performance boost by not adding an inotify watch to a symlink if it is manually going to be excluded during the sync process - so potentially worth doing. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Is your feature request related to a problem? Please describe.
I have quite a lot of large files that I don't want to add to my OneDrive that are stored in a separate disk on my machine. To access the files in my terminal I simple symlink them into directories which contains analysis scripts that I want to sync to OneDrive.
Describe the solution you'd like
Ability to simply skip symlinks. Either these would appear as symlinks once synced to OneDrive (although I'm not sure if OneDrive supports "shortcuts" like this?) or otherwise just skipped altogether.
Describe alternatives you've considered
The current alternative I use is to skip files with file extension that matches the large files I want to skip, but that doesn't avoid all the other files in the symlinked directories being synced. I could also add every symlinked directory that I don't want to sync to the config file, but this will be quite laborious. Another option would be to support a sort of
.onedriveignore
file with the same syntax asgit
.Additional context
n/a
The text was updated successfully, but these errors were encountered: