Useful .stignore Patterns

I didn’t see any other post listing useful .stignore patterns, so I thought I’d create one. Obviously everyone’s needs are different, but I’m sure there are a few patterns that would be widely useful, so here’s a place to put them instead of everyone discovering them on their own.

Also, on a related note: to sync patterns across all nodes, put the following in each node’s .stignore file:

// .stignore
//
#include .stglobalignore

Then create the .stglobalignore file and put the patterns there. An added benefit of doing this, as mentioned by @calmh in the comments, is that having the ignore patterns for a repository be the same on every device is less confusing, given the way things are implemented at the moment. You can read more about that at the main .stignore post; scroll down to Effects on “In Sync” Status at the bottom.

Here are the patterns; of course you can pick and choose as you see fit:

// .stglobalignore

// Incomplete Downloads
// At least for now, these prevent Syncthing from transferring data that's
// going to be thrown out anyway once the download is finished and the
// file is renamed. Things may change when Syncthing gets smarter.
//
// Firefox downloads and other things
*.part
// Chrom(ium|e) downloads
*.crdownload

// Temporary / Backup Files
*~
.*.swp

// OS-generated files (OS X)
.DS_Store
.Spotlight-V100
.Trashes
._*

// OS-generated files (Windows)
desktop.ini
ehthumbs.db
Thumbs.db

// BTSync files
.sync
*.bts
*.!Sync
.SyncID
.SyncIgnore
.SyncArchive
*.SyncPart
*.SyncTemp
*.SyncOld

// Synology files
@eaDir

I’ll update this post based on the comments.

17 Likes

A side note here is that as things are implemented now, it’s going to be less confusing to have the ignore patterns for a given folder be the same on each device. Otherwise things will look out of sync when they aren’t, etc.

2 Likes

Ah yea, I had read that in the main .stignore post. Good to mention :smile:.

Hi,

the idea of the global file is a very good one! … and as a BTSync refugee I can add this to the list, mostly for windows & mac users (from their “OS generated files” list):

.DS_Store
.Spotlight-V100
.Trashes
~*
ehthumbs.db
desktop.ini
Thumbs.db
._*

@calmh & friends, LOTS of thanks for your work… and to @canton7 too, without whom I would probably not have dared to try Syncthing.

2 Likes

Hi, I use .*.swp for vim temporary files and .sync fot BTSync files.

1 Like

I’m not very familiar with BTSync. Is there a .sync directory in every synced directory, or are you talking about the one config directory for BTSync, i.e. ~/.sync?

BTSync refugee here. Yes.

1 Like

If you use Syncthing on a Synology device it is useful to add these:

*@SynoResource
@eaDir
2 Likes

for vim it is .*.swp not *.swp

1 Like

I’ve never used a Synology device, but from a bit of searching it looks like the *@SynoResource files are all in the @eaDir directories. Is that correct? If so, just adding @eaDir would be enough.

1 Like

You can also add *.!sync which are the temporary files of BTSync

Sometimes my Syncthing’s start to transfer .stfolder files so I’ve added those to the ignore lists.

It doesn’t tranafer that file, its simply mandatory

Since version 2.0, btsync uses *.bts for temporary files.

oh ok. well sometimes on Windows the .stfolder files become un-hidden so I end up re-hiding them again. I guess that’s what is really happening.

(I was going to respond right after you commented, but somehow I forgot :slight_smile: .)

Is it *.!sync or *.!Sync?

Same question; is that the correct capitalization?

BT Sync 1.4 uses a hidden folder .sync in each sync folder it’s watching.

BT Sync 2.0 uses .bts file extension for temporary placeholder files. See “What is a bts file?

To see a list of all dot files BT Sync can generate, view the Unofficial FAQ and scroll down to the section marked “What are .SyncID, .SyncIgnore, .SyncPart, .SyncTemp .SyncOld and .!Sync files and the .SyncArchive folder?”

I had seen that FAQ, but honestly I was waiting for someone to ask for it before I put all those in. Thanks :smile:.

Hi! Thanks for your initiative of a default ignore file, @Cyphase!

May I suggest you to add LibreOffice temp files?

LibreOffice creates files like .~lock.filename.ext# while you’re editing a document and these files are being synced.


Did you gave it up on @eaDir folders?

1 Like

@Cyphase, shouldn’t you change “Pulse” back to “Syncthing” on your sample file?

1 Like