Run pos sync script

Hello everyone, I was wondering if it’s possible to execute a script after a file it’s synchronised.

If it’s currently not possible, it’s possible to implement?

My motivation

I’m using syncthing to send Oracle archive logs. After the files are sent to a destination there is a script that need to “apply these new files” for an standby oracle database.

My problem today it’s that some times when the script is executed there’s some files that are currently been synchronized and Oracle try to catalog those files and breaks everything.

You can write something that listens on the events API. See docs page for documentation.

1 Like

Hi Audrius, thanks for your response. So it’s possible to write a script to check for rest/db/need of a folder right?

But this is kind of reactive solution. Is not possible to write some kind of trigger inside syncthing ?

I am refering to Events API, not Rest API: https://docs.syncthing.net/dev/events.html, this https://docs.syncthing.net/events/localindexupdated.html or this https://docs.syncthing.net/events/itemfinished.html event in particular

And yes, everything is possible, the question is whether anyone is willing to spend the effort. I am sure we will accept a reasonably implemented pull request.

Same thing for owncloud file scanning, could be easily modified since it just runs php with the appropriate command line options to scan the file: