Useful .stignore Patterns

In the meantime is modified as follow

// Resilio files
.sync
!sync
*.rsls

// syncthing files
.stfolder
.stignore
.stversions
.syncthing
.syncthing*
.syncthing.*.*.tmp
~syncthing~*.*.tmp
1 Like

Iā€™ve taken all the above and consolidated it into one list. Iā€™ve also added (?d) to allow Syncthing to delete a folder if any files matching the ignore rules are preventing deletion. E.g. say a MS office temp file in a folder is preventing the folder from being deleted. (?d) overrides this behaviour and deletes the folder.


// 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
(?d)*.part
// Chrom(ium|e) downloads
(?d)*.crdownload

// Temporary / Backup Files
(?d)*~
(?d).*.swp

// OS-generated files
(?d).DS_Store
(?d).Spotlight-V100
(?d).Trashes
(?d)._*
(?d).directory
(?d)Trash-*
(?d)System Volume Information
(?d).DocumentRevisions-V100
(?d).TemporaryItems
(?d).fseventsd
(?d).localized
//temp file while syncing with (rather from) iCloud
(?d).iCloud*
(?d)$RECYCLE.BIN
(?d)desktop.ini
(?d)ehthumbs.db
(?d)Thumbs.db
(?d)Icon*
(?d).cache

//---QNAP-specific---//
(?d).@__thumb
(?d).AppleDB

//-Syncthing
(?d).stignore
(?d).stfolder
(?d).stversions
(?d).syncthing
(?d).syncthing*
(?d).syncthing.*.*.tmp

// Resilio files
(?d)*.rsls

// RDP
Default.rdp

//-Dropbox
(?d).dropbox
(?d).dropbox.attr

//-Parallels Desktop on Mac
(?d).parallels-vm-directory

//-vi(m)
(?d).*.sw[a-p] # vim uses 'o' then, 'n'... back to 'a'.

// BTSync files
(?d).sync
(?d)*.bts
(?d)*.!Sync
(?d).SyncID
(?d).SyncIgnore
(?d).SyncArchive
(?d)*.SyncPart
(?d)*.SyncTemp
(?d)*.SyncOld

// Synology files
(?d)@eaDir


3 Likes

Just a comment, but this one really probably can be let go. The file is created by Windows XP Media Center, which is long obsolete and very unlikely to be used by anyone today :relieved:.

Please support Global ignore feature request, all who needs it:

So where do you put the .stglobalignore file? I put it in the /config folder that my Docker container uses, but when I added:

// .stignore
//
#include .stglobalignore

to the share folders ignore list, it throws an error:

Screen Shot 2022-10-19 at 11.26.41 PM

Itā€™s looking inside the root of the share folderā€¦ So whatā€™s the trick? Thanks!

.stignoreglobal (or any other file that you wish to use for this purpose) is just a normal file that you create inside the synced folder. Because itā€™s not an internal filename (i.e. in contrary to .stfolder, .stignore, .stversions, etc.) it gets synced with everything else, which means that you can add #include .stignoreglobal to ignore patterns on multiple devices. Then, if you make changes to the file on one of them, the updated file will be pushed to others, and the modified ignore patterns will automatically be applied on them too.

Usually a global ignore file is stored in the root directory of the folder, which also has the advantage that it is synchronized to all connected devices to have the same information at all. Then normally also no deviations are evident between global and local status to a folder.

However, it is not mandatory to store a global ignore file in the root directory, this can also be stored centrally and a path refers to it e.g.

#include C:\data\ignorefiles\.stignoreglobal

or similar.

This isnā€™t going to work. The path is always relative to the synced folder, so if you try to add a full path like that, Syncthing will then try to look for a path in a manner of C:\Syncthing\folder\C:\data\ignorefiles\.stignoreglobal and fail. Thereā€™s a known hack/workaround to use relative paths with .. to include files from outside the synced folder, but the path itself still needs to be relative, not absolute.

DCIM/Camera

.*
(?i)!/*.{mp4,jpg}
*

Pictures/Screenshots (or DCIM/Screenshots)

.*
(?i)!/*.{mp4,jpg}
*

Other

DCIM/Camera

.*
(?i)*.{tmp,temp}
!/*.*
*

DCIM

.*
(?i)*.{tmp,temp}
!/Camera/*.*
!/Screenshots/*.*
*