I need a real-time filesystem watcher that detects when any file in ~/.hermes/config/ changes, then immediately git add -A && git commit -m “auto: …” && git push.

Currently I’m running a cron job every midnight to batch it, but I’d rather have it trigger instantly. On Arch (btw) what’s the cleanest approach?

I’ve looked at:

  • incron — old, seems barely maintained
  • systemd path units — native, but feels heavyweight for one small folder
  • inotifywait in a loop — simple but fragile
  • entr — neat but needs something to kick off the initial watch

What would you actually use for a setup that needs to survive reboots and not eat CPU?

  • Eggymatrix@sh.itjust.works
    link
    fedilink
    arrow-up
    2
    ·
    4 hours ago

    Greybeard dev here, just stepping by to say I would do the same, this works and does nothing weird if there is nothing to commit.

    I don’t know what the problem of the other crying person is, but robust IO watching should not be done in bash and whatever the fancy solution is it will not work as reliably as this.