Use ignore patterns to sync only PDF files

I have trouble getting ignore patterns to sync only PDF-Files

i tied this:

!*.pdf

and this:

!*.pdf *

last one seems to copy everything.

first one (!*.pdf) is copes zip files tmp files and much more.

Actually

!*.pdf
*

should ignore everything except pdf files in the root of the folder and

!*pdf

should not ignore anything.

I think this isn’t possible with the current implementation of ignores. Even if you use double asterisk to match the entire path like this

!**.pdf
*

the parent folder of any pdf file will match * and thus be ignored (and the children are skipped/ignored). Do I miss something or is this really not possible?

Yes youre code works. interesting. host shows me:

Out of Sync Items 190 items, ~0 B Folder Type Send Only

and inside list of the Out of Sync there are only PDF-Files.

and client recieved no PDF-Files.

but files like this:

~syncthing~synCache.dat.tmp 0 MB ~syncthing~2015-03-31 15_31_52-Netzausbau_Telekom.png.tmp 1,9 MB

that surprises me. For my sake, tmp files can remain in the folders, if PDF files are there. Then I would find that very well.

its possible to press “override changes”.

Fortunately, 190 PDF was transferred. Correctly distributed to 90 folders.

I hope it is possible to sync every 60 seconds PDFs without having to press this button? (found this discussed here: Automatic overwrite changes · Issue #1972 · syncthing/syncthing · GitHub )

Yes :blush: I am positively surprised. I do not have to press this button every 60 seconds to synchronize the PDFs. The first time was enough. Apparently the program remembers this decision for the next changes. I’m curious to see if this remains persistent for the next session.

tmp files are automatically cleared after some time https://docs.syncthing.net/users/syncing.html#temporary-files you can also trigger override with API https://docs.syncthing.net/rest/db-override-post.html

1 Like

Actually, the command is not really safe. But works so for me. For example, helloWorld.ahk.log.txt will also be copied. By the way, in PREG syntax, you are (to prevent this): ahk .*.ahk$ (online tester: https://regex101.com/r/WbPPdy/2 )

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.