I have a directory tree like the following on my Windows PC:
Root dir + SubDir1 - file1.txt - file2.txt + SubDir2 - someotherfile.txt - backup1.rar - backup2.rar - backup3.rar - BackupFull.rar - somethingelse.rar
The only files I want to sync are the ones beginning with
backup (case-insensitive). I thought about using the
.stignore file for that, but so far, my attempts to do so have all failed. I tried:
// First try (?i)!backup* * // Second try (?i)!backup* !/ /* * // Third try (?i)!backup* !./ ./* *
So, what is the correct way?
note: found this https://forum.syncthing.net/t/use-ignore-patterns-to-sync-only-certain-files-of-one-folder/1816 but that’s different because OP wants to sync files inside a subfolder while mine are in the root directory.
Edit The following seems to work:
!/backup* /* !/ *
1- The first line makes both files beginning with
Backup to sync. This is unexpected! If I use
(?i)!/backup* instead, it wont work.
2- Switching lines 2 and 3 causes it to stop working. Why is that?