# Hook to start another program on sync conflict

**URL:** https://forum.syncthing.net/t/hook-to-start-another-program-on-sync-conflict/25484
**Category:** Feature
**Created:** [October 14, 2025, 3:47pm UTC](https://forum.syncthing.net/t/hook-to-start-another-program-on-sync-conflict/25484 "2025-10-14T15:47:21Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ph1248](https://forum.syncthing.net/user_avatar/forum.syncthing.net/ph1248/32/20007_2.png) [@ph1248](https://forum.syncthing.net/u/ph1248)
#### Post date: [October 14, 2025, 3:47pm UTC](https://forum.syncthing.net/t/hook-to-start-another-program-on-sync-conflict/25484/1 "2025-10-14T15:47:21Z")

</div>

Hello everyone,

this is another feature request concerning notification about sync conflicts. I am aware of the other threads such as the ones I have quoted below. However, I’d like to propose a flexible approach:

I would like to have 2 features:

1. In the config file, I would like to set a hook, meaning a path to an executable which is called whenever a sync conflict arises (once for each file). I would imagine that the following parameters should be handed over in the call:

- 1. name of the file which caused the conflict
- 2. name of the newly created “.sync-conflict…” file.
- 
  1. local folder of the file which caused the conflict

- 4.+5. names of the two machines the conflict was detected with.
- Possibly there might be other useful parameter like “reason for conflict”, but I don’t know enough to judge that.

1. This hook (if it is indeed set in the config file) should be called with the parameters described above whenever a sync conflict occurs. The hook should be called on all machines where the file in question is synced with. To this end, the machine where the conflict is detected should notify the other sync’ing machines about it.

In this way we are quite flexible about what to do about the conflicts. One can set up a user notification, or a log, or whatever. In my use case I run syncthing on a debian server and would use that to trigger an email to myself about it, maybe filtered for only some of the sync’ed folders.

What do you think about that? Is that feasable?

BTW: Thanks a lot for the great tool!

* * *

Here are the similar threads, FYI:

> [@Syncthing should keep conflict files log OR notify about them.](https://forum.syncthing.net/t/syncthing-should-keep-conflict-files-log-or-notify-about-them/24498):
>
> It would be really useful if we can get notified when syncthing has created a conflict file, so I can resolve that conflict in time. OR At least syncthing can keep a log of what conflict files it created if any. And I can set a weekly reminder for myself to check those logs and resolve the conflicts. This feature is especially needed when we are syncing those directories which we don’t navigate to directly to access its content. Example: I use syncthing to sync my logseq graph.

> [@Better Conflict Resolution in UI](https://forum.syncthing.net/t/better-conflict-resolution-in-ui/23689):
>
> I’ve been enjoying SyncThing to connect important folders on my 3 home computers. However, sync conflicts arise from time to time (probably from the fact my laptop goes on and offline) and I’m never quite sure how to handle them. Also the sync conflict files clutter up my drive. I wish there was a way in the UI to see a list of the conflicted files and be able to manually select which one to keep. Furthermore, I wish there was a folder preference for auto conflict resolution. If enabled, th…

---

<div class="post-metadata">

### Author: ![acolomb](https://forum.syncthing.net/user_avatar/forum.syncthing.net/acolomb/32/11343_2.png) [@acolomb](https://forum.syncthing.net/u/acolomb)
#### Post date: [October 15, 2025, 5:27am UTC](https://forum.syncthing.net/t/hook-to-start-another-program-on-sync-conflict/25484/2 "2025-10-15T05:27:58Z")

</div>

There is a fundamental difference between the device creating the conflict file and the ones receiving it. I’m not sure we have an API event for the former, but the latter simply see the conflict as a file addition with a name matching a certain pattern.

A useful addition would be an event for new conflict file creation.

Anything involving running arbitrary commands would better be solved by an external daemon listening to the Event API. That way, its could solve lots of different needs for calling hook scripts.

---

<div class="post-metadata">

### Author: ![ph1248](https://forum.syncthing.net/user_avatar/forum.syncthing.net/ph1248/32/20007_2.png) [@ph1248](https://forum.syncthing.net/u/ph1248)
#### Post date: [November 1, 2025, 2:24pm UTC](https://forum.syncthing.net/t/hook-to-start-another-program-on-sync-conflict/25484/3 "2025-11-01T14:24:29Z")

</div>

Thank you for your reply.

A daemon listening to the API may technically be the better solution. However, I don’t have the techical knowledge to build such a daemon. What I could manage would be to write a bash script, hence my request for a solution where I could simply set the path to such a script in the config file. But maybe there could be a general daemon which could be configured to trigger scripts on ceratain events.

Whatever the solution my be in the end, what do i have to do to make this a proper feature request which may be implemented?

---

<div class="post-metadata">

### Author: ![chaos](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/c/9d8465/32.png) [@chaos](https://forum.syncthing.net/u/chaos)
#### Post date: [November 2, 2025, 10:20am UTC](https://forum.syncthing.net/t/hook-to-start-another-program-on-sync-conflict/25484/4 "2025-11-02T10:20:25Z")

</div>

Write a script to look for conflict files and let you know? And use cron to run it periodically?
