.SyncIgnore Example Request


Recommended Posts

Please help me understand what I'm doing wrong. I've got a folder E:\Projects that I'd like to sync between 2 computers. I have 3 subfolders I'd like to have ignored (folder1, folder2, and the secific subfolders inside of them)

In windows 7, I open notepad++ and change encoding to UTF-8. Save the file as .SyncIgnore in E:\Projects. I then add 3 lines to .syncignore file:


\folder1\sf1
\folder1\sf2
\folder2\sf1

I save this, then start Sync application. I generate a key, and add E:\Projects to shared folders. When I look in the History tab, I see that files from the ignored paths are being added.

Would appreciate any help.

Thanks.

Link to comment
Share on other sites

"\folder1\sf1" for example won't ignore everything in "folder1"... it will only ignore files/folders within the "sf1" sub directory of "folder1". Any other files/folders within "folder1" itself won't be ignored (excluded) from the sync. To exclude the entire contents of "folder1" (including all its sub directories), consider using the "*" wildcard.

There are some .SyncIgnore examples, including how to use wildcards, in the unofficial FAQ

Don't forget as well that your .SyncIgnore files need to be identical at all the locations you're syncing your "projects" folder to.

Link to comment
Share on other sites

GreatMarko, thanks.

I did want to sync some of folder1, just not the large folders. I've tried doing as you said, and the folders are still being indexed and synchronized. Are the paths in the .syncignore file supposed to be relative? Does it matter if the slashes are front or backward? Seems I've tried all variations of these and the folders I'd like to ignore keep syncing.

I've tried:

E:\Projects\folder1\sf1

E:/Projects/folder1/sf1

E:\Projects\folder1\sf1\*

E:\Projects\folder1\sf1\*.*

\folder1\sf1\

\folder1\sf1\*

None of these seem to be working for me. Once I've tried them, and see that the unwanted folders are still syncing, I remove the folder from btsync and close the program. Then I would try a different variation and restart btsync.

The .syncignore file is supposed to be at the root of the folder I'm sharing, correct? (E:\Projects). Seems like I'm missing something very simple here.

Link to comment
Share on other sites

I've been playing around with .SyncIgnore and have noticed the following things:

  • If you specify a wildcard, .e.g., file*, everything matching that--including in all subdirectories--is ignored.
  • If you add a file/dir to .SyncIgnore after it has already sync'd, it will be removed from other peers (actually just placed in their .SyncTrash directories).
  • I have also just tried a number of different permutations of a subdirectory in an attempt to get BTSync to ignore but it doesn't seem to work on directories--only on files (and even this seems hit-and-miss when adding file masks to files that have already sync'd)...
  • You may have to close the .SyncIgnore file when you're done editing it (not just save).

Then, I exited BTSync on the host of the files (readonly secret, remember), and restarted BTSync ... all of a sudden it deleted on the peer all of the subdirectories I had specified in .SyncIgore (well, moved to .SyncTrash of course). It also deleted a filemask I had specified after the file had already sync'd (although earlier in the test this worked without restarting BTSync).

So I guess the lesson for now is just to restart BTSync when you update .SyncIgnore. I would think only restarting BTSync on the host with the changed .SyncIgnore is enough (at least it was in my case, and restarting the read-only peer didn't have any effect).

To ignore a subdir I simply specified it like:

subdir

Or a file within:

subdir/file

Nothing special. I used "/" in the UNIX-compatible syntax even though it was on Windows. I tried relative and absolute paths (including drive letter) and it didn't work until restarting BTSync. And when I restarted BTSync and saw the changes take effect, I was only using relative paths.

I also upgraded the host to build 125 and didn't see any difference in this behavior.

I was using Win7 as both the source and the read-only peer for these tests.

I observed changes tended to replicate within about 5 seconds on my LAN.

Hope this helps a bit!

Link to comment
Share on other sites

If you specify a wildcard, .e.g., file*, everything matching that--including in all subdirectories--is ignored.

This is correct behavior.

If you add a file/dir to .SyncIgnore after it has already sync'd, it will be removed from other peers (actually just placed in their .SyncTrash directories).

This is why you should make changes to .SyncIgnore when BitTorrent Sync ISN'T running, and also ensure that the corresponding .SyncIgnore files on your other devices are identical before restarting BitTorrent Sync on all your devices

You may have to close the .SyncIgnore file when you're done editing it (not just save).

It's more a case of making sure you restart BitTorrent Sync after making any changes to SyncIgnore

There's more information on how the steps to correctly modify .SyncIgnore files in this post

Link to comment
Share on other sites

I've been playing around with .SyncIgnore and have noticed the following things:

  • If you specify a wildcard, .e.g., file*, everything matching that--including in all subdirectories--is ignored.
  • If you add a file/dir to .SyncIgnore after it has already sync'd, it will be removed from other peers (actually just placed in their .SyncTrash directories).
  • I have also just tried a number of different permutations of a subdirectory in an attempt to get BTSync to ignore but it doesn't seem to work on directories--only on files (and even this seems hit-and-miss when adding file masks to files that have already sync'd)...
  • You may have to close the .SyncIgnore file when you're done editing it (not just save).

Then, I exited BTSync on the host of the files (readonly secret, remember), and restarted BTSync ... all of a sudden it deleted on the peer all of the subdirectories I had specified in .SyncIgore (well, moved to .SyncTrash of course). It also deleted a filemask I had specified after the file had already sync'd (although earlier in the test this worked without restarting BTSync).

So I guess the lesson for now is just to restart BTSync when you update .SyncIgnore. I would think only restarting BTSync on the host with the changed .SyncIgnore is enough (at least it was in my case, and restarting the read-only peer didn't have any effect).

To ignore a subdir I simply specified it like:

subdir

Or a file within:

subdir/file

Nothing special. I used "/" in the UNIX-compatible syntax even though it was on Windows. I tried relative and absolute paths (including drive letter) and it didn't work until restarting BTSync. And when I restarted BTSync and saw the changes take effect, I was only using relative paths.

I also upgraded the host to build 125 and didn't see any difference in this behavior.

I was using Win7 as both the source and the read-only peer for these tests.

I observed changes tended to replicate within about 5 seconds on my LAN.

Hope this helps a bit!

Thanks, useful info right there.

Link to comment
Share on other sites

  • 1 month later...

Can anyone confirm that .SyncIgnore actually functions at all in Linux? I have a huge folder in my home directory that I don't want to index or sync. I tried putting all of these lines in /home/stevecrozz/.SyncIgnore:

Projects

Projects*

Projects/

/home/stevecrozz/Projects

/home/stevecrozz/Projects*

/home/stevecrozz/Projects/

Then I add my home folder (/home/stevecrozz) to btsync. But the .SyncIgnore has no effect. I can run strace -p<btsyncpid> and I can see btsync stat()ing every file in this this folder which takes forever. When its finally done indexing, it does begin to synchronize this folder. How do I make it stop?

Link to comment
Share on other sites

Thanks binarybana, I'm trying the same version of btsync now with a single entry 'Projects' in my .SyncIgnore file. It still isn't ignoring anything. I'm wondering if it has to do with the fact that Projects is actually an encrypted folder mounted with ecryptfs. I'll see I can get .SyncIgnore to work in a smaller folder. The 4-5 hour attempt/fail cycle is not helping me out here.

Link to comment
Share on other sites

When I was first testing .SyncIgnore, I made a new empty folder, made a few dummy rules and then verified that it worked the way I wanted it to. You might try that to reduce your debug cycle time :), and then once you have that working, you can try with a nearly empty ecryptfs mount point too.

Link to comment
Share on other sites

  • 1 month later...

When adding exclusions to the .SyncIgnore

  1. Do I need to add the whole directory or just keywords or filetypes?
  2. Do you modify the .SyncIgnore file that's automatically created and add your blacklist to the bottom? Or do you create a new file and include ONLY the blacklisted items?
  3. The .SyncIgnore file I need to modify is on the machine originally holding the files, not the client receiving them, correct?

I've been dinking around with this for awhile and can't get it to work at all and am assuming I'm making an elementary mistake, so please point me to an idiot-proof guide. Thanks!

Link to comment
Share on other sites

1. Whatever you want. Consider every line a path or pattern that applies to both directories and files.

2. Modify the generated file unless you want remove the default rules.

3. Correct and for now you manually have to copy the SyncIgnore files to each and every client. The devs still haven't decided if they'd just sync it or make it client specific and apply it to incoming files too (selective sync).

There are topics that even have examples for the patterns you can use. Think of it as unix glob paths.

Please use the search box to find out more.

Link to comment
Share on other sites

  • 2 months later...

I have two machines.

1. Base, x64 ubuntu with btsync v 1.1.822

2. Work, x32 ubuntu with the same version of btsync.

 

Every side works in rw mode, it means full access on both machines.

My goal was to synchronize everything on base system, and let the work machine sync only part of the base.

So i used default .SyncIgnore on base, but edited work's file with adding:

moviesmusic

It does not help. btsync on work still tried to download these folders.

Then i edited work's .SyncIgnore with this:

/movies*/music*

And it works fine. Base synchronized everything, and work machine did not downloaded these two folders.

This implementation is similar to using btsync on tablet or smartphone, where you can set diffrent folder to sync, by tapping with finger.

 

Next goal: make synchronizable usb-drive, that i can connect to any of these pcs and start automatical sync.

But btsync can't do that, becouse it can't add same sync folder to the usb-drive in one system. It think, that system's sync folder and usb-drive belongs to one "sync unit".

Link to comment
Share on other sites

  • 11 months later...
  • 1 month later...

How do I escape special characters?

 

I have folders that start with '+' but just putting '+directory' in .SyncIgnore doesn't seem to work, and the usual escape character '\' doesn't function, as it indicates directory traversal.

 

EDIT: I was able to accomplish this by using a wildcard: '?directory'

Edited by Narfe
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.