Selective Sync Not Being Applied To Some Files And Folders


c0wb0yc0d3r

Recommended Posts

I was just wondering if anyone else was seeing this behavior.

 

I have selective sync enabled on the sync folder.  However, when I try calling the api to disable sync on a directory, the file info returned doesn't indicate download is equal to 0 and the directory is still synced.

 

Has anyone encountered this and found a solution?

Link to comment
Share on other sites

Ok so first I I created the sync folder located at "~/files" using add_folder with selective_sync set to 1. This returned { 'error':0 } as expected.

 

Next,I then proceeded to call set_folder_prefs on every directory (and any files that don't match certain file extensions) contained in "~/files".  I get file info back however, it never says download:0 or even download:1.  I have no idea what to really expect here seeing as the documentation doesn't clearly state what sort of result I should see. I would expect to see file info indicating that the download property had been set accordingly or an error.

 

Finally, (I assumed everything has gone correctly) I setup another machine to sync from this share. Almost instantly it begins syncing every directory in the shared folder even though I has been instructed not to.

 

I have tried accomplishing this task 2 ways.

1. using this PHP class: https://github.com/iGARET/BTSync-PHP

2. using the Google Chrome address bar

 

Both lead to directories I don't want to be synced.

 

If anyone needs anymore info let me know.

Link to comment
Share on other sites

@c0wb0yc0d3r

 

set_folder_prefs sets preferences to whole Sync folder. You don't need to call it for every subfolder or file inside sync folder. To get file downloaded with Selective Sync you need to call set_file_prefs. Note, that the path to a file should be relative to the sync folder.

Link to comment
Share on other sites

No I am trying to exclude files, and so I tried iterating over every file and directory located at the root of the sync folder yet I as still seeing every directory being synced.  I will try again tonight and see what happens.

 

Just as an update to the situation:

 

I want to sync a folder that has pictures and videos. When I enable selective sync, all files and folders still sync (this is expected as I have not disabled sync for anything).  Next I wrote a script that iterates of every file and directory in the root of the sync folder. After the script runs (actions of the script were verified by output to stdout), directories that had syncing disabled were still synced.  I thought there might be a problem with my script, so I turned to using Google Chrome and typed out the API call manually in the address bar. Still no success.

Link to comment
Share on other sites

  • 4 weeks later...

@c0wb0yc0d3r

 

When you mark folders to be "Download" or not "Download" in selective Sync, actually all the files inside them are marked, not the folders. Folder structure created immediately when 2 peers connect regardless if any of them is using selective sync or not.

 

When I enable selective sync, all files and folders still sync (this is expected as I have not disabled sync for anything).

I'm a bit confused with this statement. Selective Sync can be enabled or disabled only when you add a folder. And when you do so, all files will not be downloaded by default. 

 

Do I understand correctly that you add a folder with Selective Sync and it immediately starts downloading files?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.