You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Could we have a .stsharedignore file that gets synchronized between all the devices? #7311
I want to ignore a set of files on all my nodes.
Right now, the only "half workaround" is adding the line
#include .stglobalignore
To the file .stignore, but I have to manually add this line in all my devices and that is not always easy to achieve.
Would be possible to have a second ignore file that gets synchronized between devices?
PS: One options that I saw in the forums was to always create a .stignore file with that line in all shared directories. If .stglobalignore is not present, nothing happens and if exits it works as intended.
Reacted by Salim B, WhoKnows, github user, Matthew Lloyd, Ander, adam4235, Lev Gorodetskii, Roman Leukin, Timo Hardebusch, cyqsimon and 26 more
Syncing ignore patterns is much trickier (or has much trickier effects, at least) than most people assume at first glance. It's often discussed, never implemented, so far. I don't see a specific issue for it other than the sprawling next-gen-ignores disaster so I'mma let this one stay for now.
Idea:
Create a category [global] inside .stignore
If a . stglobalignore appear, syncthing copy it's content (also section [global] ) to the global section of .stignore (replace all earlier content) add the log of this to .stglobalignore in the [LOG] section and rename the File to.stglobalignore-devicename-log file after that. If all connected client renamed this file, on the source machine several logs appear and you know which device is missing.
Please do not start yet another "ignore ideas" issue - there is already one with a whole lot of that: #2491. If you are actually interested in working on it, by all means share and discuss your plans. Otherwise there is no point in doing so.
This issue is still open because I do believe the use-case will be solved by having "default-ignores" which get applied on folder creation. And I do intend to implement that.
Reacted by Zac
Reacted by Aaron Muir Hamilton, contrun, Lauren, Jonny999999, AlekseyMko and Enerccio
Syncing ignore patterns is much trickier (or has much trickier effects, at least) than most people assume at first glance. It's often discussed, never implemented, so far. I don't see a specific issue for it other than the sprawling next-gen-ignores disaster so I'mma let this one stay for now.
I just want Syncthing to ignore those damit .DS_Store files from MacOS by default...
Reacted by Darik Horn and revolving-leslie
Reacted by Chris [scuba.tech], AlekseyMko, dejafait and Derek Parks
All I have in use in my .stignore files is: #include .stignore.synced
this leads to 100% CPU usage and sync fail/stuck/cyclic fail in case of file was deleted in synced directory and other nodes are also configured to use #include tag. I had even ALL the data lost in one folder, luckily on primary node Trash Can was enabled so I was able to recover.
We really need a GLOBAL synchronizable configuration for ignore which automatically propagates to all new joined sync nodes.
By the way, the global ignore sync information could even be stored in share metadata, still having regular ignore file, then sections Local ignore and Global ignore should be separated and change would not be breaking for existing users and setups.
this leads to 100% CPU usage and sync fail/stuck/cyclic fail in case of file was deleted in synced directory and other nodes are also configured to use #include tag.
Nowadays you can add a #include .stignore-shared or similar to your default ignores.
Just to be safe and make sure the shared ignore patterns actually do get applied right from the start, before the .stignore-shared file has synced, add this to your default ignore patterns:
!/.stignore-shared
*
#include .stignore-shared
After the folder has synced for the first time, just edit its individual ignore patterns and remove the single * line.
this leads to 100% CPU usage and sync fail/stuck/cyclic fail in case of file was deleted in synced directory and other nodes are also configured to use #include tag.
I had even ALL the data lost in one folder, luckily on primary node Trash Can was enabled so I was able to recover.
That doesn't seem related - anyway if you can reproduce please open a new bug ticket.
Nowadays you can add a #include .stignore-shared or similar to your default ignores.
This still does not solve the issue of Global ignore I mentioned here and here.
This relates to multi platform nodes and version control dirs especially when new nodes join the share. Every node should be manually configured for every share joined now, and this is real PITA especially if share is sent to regular 'computer user' who calls browser 'Google' 😃
The process is a bit mysterious to me. I use the two files shown on all devices (Linux, Windows, Android) and in all folders.
With one special exception, the .stignore only contains "#include .stglobalignore" (nothing else) and I had to distribute this file once because it is not synced. The .stglobalignore is synced perfectly across all devices and folders and in no way leads to 100% utilization. Would it be possible that the dash "-" or point "." in your name interferes?
It's a pity that this global option is only folder-related, which is why I would also like to be able to set up global and device-related ignore patterns.
In my case problem arised for shares with 1GB and 300 items, and another one with 44GB and ~650k files.
Still there was auto-accept from master setup on that node, and somehow this led to delete of all contents of first share, this delete spread across all nodes, and all of then entered cyclic fail loop leading to 100% CPU usage. I hope that mentioned fix 8232 will avoid that situation again because of missing ignore file.
May be this was sync failure related, not sure, but I suspect that joined node empty share made a delete command to other nodes.
I have also exact setup with two files, where another is called .stgignore and .stignore contains only one include line.
I didn't say it does address this issue fully, otherwise I'd have closed the ticket ;)
I just explained what other changes have been made that make the use-case here a bit less annoying.
Nowadays you can add a #include .stignore-shared or similar to your default ignores.
Just to be safe and make sure the shared ignore patterns actually do get applied right from the start, before the .stignore-shared file has synced, add this to your default ignore patterns:
!/.stignore-shared
*
#include .stignore-shared
After the folder has synced for the first time, just edit its individual ignore patterns and remove the single * line.
This pattern didn't work for me. The new folder is stuck in Waiting to Sync state and I get the following warning:
Loading ignores: parse error: failed to load include file .stglobalignore: open /Users/macos/Sync/test/.stglobalignore: no such file or directory
Error on folder "test" (rewxw-scvru): loading ignores: parse error: failed to load include file .stglobalignore: open /Users/macos/Sync/test/.stglobalignore: no such file or directory
I now use this as default ignore pattern instead:
// Only sync the .stglobalignore file initially
!/.stglobalignore
// EDIT: uncomment the line below once the .stglobalignore has been synced
// #include .stglobalignore
// EDIT: edit and uncomment lines below once .stglobalignore has been synced to selectively sync some folders
// !/Pictures
// !/Work
// Ignore everything else by default
*
This way on initial sync only the .stglobalignore will be synced. Once that's done I can 'selectively' sync some subdirectories (or everything else by removing the asterisk).
this leads to 100% CPU usage and sync fail/stuck/cyclic fail in case of file was deleted in synced directory and other nodes are also configured to use #include tag.
I had even ALL the data lost in one folder, luckily on primary node Trash Can was enabled so I was able to recover.
That doesn't seem related - anyway if you can reproduce please open a new bug ticket.
Nowadays you can add a #include .stignore-shared or similar to your default ignores.
its not, syncthing will STILL have high cpu usage if one side is sending a change that is ignored. Not syncing .stignore is huge gotcha that NO ONE expects!!!!
Activity
calmh commentedon Jan 29, 2021
Syncing ignore patterns is much trickier (or has much trickier effects, at least) than most people assume at first glance. It's often discussed, never implemented, so far. I don't see a specific issue for it other than the sprawling next-gen-ignores disaster so I'mma let this one stay for now.
Mannshoch commentedon Feb 11, 2021
Idea:
Create a category [global] inside .stignore
If a
. stglobalignoreappear, syncthing copy it's content (also section [global] ) to the global section of.stignore(replace all earlier content) add the log of this to.stglobalignorein the [LOG] section and rename the File to.stglobalignore-devicename-logfile after that. If all connected client renamed this file, on the source machine several logs appear and you know which device is missing.imsodin commentedon Feb 11, 2021
Please do not start yet another "ignore ideas" issue - there is already one with a whole lot of that: #2491. If you are actually interested in working on it, by all means share and discuss your plans. Otherwise there is no point in doing so.
This issue is still open because I do believe the use-case will be solved by having "default-ignores" which get applied on folder creation. And I do intend to implement that.
nshtg commentedon Mar 5, 2021
I just want Syncthing to ignore those damit .DS_Store files from MacOS by default...
calmh commentedon Mar 5, 2021
So you want a default set of ignore patterns, which is something entirely different than a shared, synced set of ignore patterns.
imsodin commentedon Mar 6, 2021
User-configurable default ignores applied at folder creation: #7428
Application defaults for such default ignores: #837
mrtimdog commentedon Oct 5, 2021
All I have in use in my
.stignorefiles is:#include .stignore.syncedpagalba-com commentedon May 11, 2022
this leads to 100% CPU usage and sync fail/stuck/cyclic fail in case of file was deleted in synced directory and other nodes are also configured to use #include tag. I had even ALL the data lost in one folder, luckily on primary node Trash Can was enabled so I was able to recover.
We really need a GLOBAL synchronizable configuration for ignore which automatically propagates to all new joined sync nodes.
pagalba-com commentedon May 11, 2022
By the way, the global ignore sync information could even be stored in share metadata, still having regular ignore file, then sections Local ignore and Global ignore should be separated and change would not be breaking for existing users and setups.
imsodin commentedon May 11, 2022
That has been fixed: #8232
That doesn't seem related - anyway if you can reproduce please open a new bug ticket.
Nowadays you can add a
#include .stignore-sharedor similar to your default ignores.acolomb commentedon May 11, 2022
Just to be safe and make sure the shared ignore patterns actually do get applied right from the start, before the
.stignore-sharedfile has synced, add this to your default ignore patterns:After the folder has synced for the first time, just edit its individual ignore patterns and remove the single
*line.pagalba-com commentedon May 11, 2022
Thats great!
This still does not solve the issue of Global ignore I mentioned here and here.
This relates to multi platform nodes and version control dirs especially when new nodes join the share. Every node should be manually configured for every share joined now, and this is real PITA especially if share is sent to regular 'computer user' who calls browser 'Google' 😃
Kaelber commentedon May 11, 2022
The process is a bit mysterious to me. I use the two files shown on all devices (Linux, Windows, Android) and in all folders.
With one special exception, the .stignore only contains "#include .stglobalignore" (nothing else) and I had to distribute this file once because it is not synced. The .stglobalignore is synced perfectly across all devices and folders and in no way leads to 100% utilization. Would it be possible that the dash "-" or point "." in your name interferes?
It's a pity that this global option is only folder-related, which is why I would also like to be able to set up global and device-related ignore patterns.
pagalba-com commentedon May 11, 2022
In my case problem arised for shares with 1GB and 300 items, and another one with 44GB and ~650k files.
Still there was auto-accept from master setup on that node, and somehow this led to delete of all contents of first share, this delete spread across all nodes, and all of then entered cyclic fail loop leading to 100% CPU usage. I hope that mentioned fix 8232 will avoid that situation again because of missing ignore file.
May be this was sync failure related, not sure, but I suspect that joined node empty share made a delete command to other nodes.
I have also exact setup with two files, where another is called .stgignore and .stignore contains only one include line.
imsodin commentedon May 11, 2022
I didn't say it does address this issue fully, otherwise I'd have closed the ticket ;)
I just explained what other changes have been made that make the use-case here a bit less annoying.
And github tickets are not for discussions/support - please use https://forum.syncthing.net if you have any further questions or want to discuss workarounds. The forum has a lot more eyes and friendly people on it than the issue tracker. Thanks!
Jip-Hop commentedon Jun 5, 2022
This pattern didn't work for me. The new folder is stuck in
Waiting to Syncstate and I get the following warning:I now use this as default ignore pattern instead:
This way on initial sync only the
.stglobalignorewill be synced. Once that's done I can 'selectively' sync some subdirectories (or everything else by removing the asterisk).feat(ignore): auto-load .stglobalignore as shared folder ignore patterns
feat(ignore): auto-load .stglobalignore as shared folder ignore patterns
docs(ignoring): document .stglobalignore shared ignore patterns
Enerccio commentedon Aug 20, 2026
its not, syncthing will STILL have high cpu usage if one side is sending a change that is ignored. Not syncing .stignore is huge gotcha that NO ONE expects!!!!