I’m currently syncing between windows and macOS. As an example, I want to ignore my .dmg files that are on my Mac to not sync to my windows computer and and my .exe files on windows from going to mac.
I hadn’t been doing this for a while so I currently have a mix of files that are incompatible across devices.
I went and added an extensive ignore list to my .stignore file. Does this only need to go on my Mac? If I do this on my Mac what would the result be when deleting a file on my windows computer?
# Created by https://www.toptal.com/developers/gitignore/api/macos
# Edit at https://www.toptal.com/developers/gitignore?templates=macos
### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### macOS Patch ###
# iCloud generated files
*.icloud
# End of https://www.toptal.com/developers/gitignore/api/macos
.DS_Store # Finder metadata file
._* # AppleDouble metadata files (created when copying to non-Mac file systems)
.AppleDouble # Apple resource fork storage
.fseventsd # File system events log directory
.Spotlight-V100 # Spotlight search index files
.Trashes # Trash folder files
.VolumeIcon.icns # Custom volume icons
# Ignore macOS-specific application formats
*.app/ # macOS applications (bundles)
*.dmg # macOS disk image files
*.pkg # macOS installer packages
*.sparsebundle # Mac encrypted disk image format
*.sparseimage # Mac disk image format
*.mobileconfig # Mac configuration profiles
In this case, with just two devices, I’d suggest to use the same ignore patterns on both sides. Otherwise, you will end up with different global and local states, and it may be difficult to manage them in the long term.
However, I also need to point out that the ignore patterns listed above are not going work. This is because you seem to have used a gitignore generator to create them, and there are syntax differences between that and Syncthing’s ignore patterns.
For one, you cannot use the #
character to comment, you need to use //
instead. You must move the comments to separate lines and not put them after the file names as well. The two \r
after Icon
are also not going to do anything.
Please read up https://docs.syncthing.net/users/ignoring if you haven’t already.
1 Like
Thank you for the advice. Here is my final ignore for windows and mac. I’m not sure if i should ignore those temp files at the bottom.
// ----------------------
// ----------------------
// macOS System Files
(?d).DS_Store
(?d).LSOverride
(?d)Icon?
(?d).DocumentRevisions-V100
(?d).fseventsd
(?d).Spotlight-V100
(?d).TemporaryItems
(?d)*.pkg
(?d)*.apkg
(?d).Trashes
(?d)*macos*.tar.gz
(?d)*.ics
(?d)*.numbers
(?d).VolumeIcon.icns
(?d).apdisk
(?d)._* // Resource fork files
(?d).localized // Finders localized folder info
// ----------------------
// iCloud Generated Files
(?d)*.icloud
// ----------------------
// macOS Application Formats
*.app/ // Application bundles (directories)
*.dmg
*.pkg
*.sparsebundle
*.sparseimage
*.mobileconfig
*.kext/ // Kernel extensions (if applicable)
// ----------------------
// Windows System Files
(?d)Desktop.ini
(?d)$RECYCLE.BIN
(?d)*.msi
(?d)*.msix
(?d)*.msm
(?d)*.msp
(?d)*.lnk
(?d)*.exe
(?d)*.dll
(?d)*.ps1
(?d)*.bat
(?d)unattend.xml
(?d)LocalState
(?d)*.cmd
(?d)System Volume Information
// ----------------------
// Windows Temporary/Backup Files
// (?d)*.tmp
// (?d)~$*
Make sure to move those inline comments to separate lines as well. Otherwise, Syncthing will literally look for files matching *.kext/ // Kernel extensions (if applicable)
.
1 Like
So, I’ve used those rules exactly as shown. I’m currently trying to clean up the folder and delete things. However, I’m getting this error.
Both of my instances of syncthing are sharing the same ignore file. What is causing the delete issues?
The only way for me to clear this is to go and manually delete the files.
It seems that Syncthing hasn’t got permissions to delete those files. The error message mentions ignore patterns, however this is unrelated to them, and the folders cannot be deleted, because the files inside them need to be removed first.
This is happening on my mac. Do i need to grant it special permission to do this?
I just checked and I have given syncthing full disk access.
Okay, I fixed it. I dont understand mac’s ACLs when it comes to files.
View your files ACLs ls -le
I had a bunch of files that had
-rw-r--r--@ 1 user staff 343858 Aug 13 2020 12.2018-01.2019(1).pdf
0: group:admin allow read,write,append,readattr,writeattr,readextattr,writeextattr,readsecurity
1: group:everyone deny delete <---- this thing!!!
I don’t know why it was like that.
I executed this in the directory and then syncthing was able to sync
chmod -R -N .