all 12 comments

sorted by: hot top controversial new old
[–] 12 points 4 months ago

Inotify is the official kernel supported tool that uses the inotify API, again that is the official kernel API for monitoring files and folders.

Its not that immediate to use, specially because there are caveats but works reliably well and indeed get the job done. Why do you say fragile? There isn't a more comprehensive approach.

Only issue, doesn't work on NFS and Samba shares.

  • source
  • [–] 5 points 4 months ago* (last edited 4 months ago)

    inotifywait in a loop? Why not something like this?

    inotifywait -m -r -e create,delete,modify,move /home/.hermes/config
    
  • source
  • [–] 3 points 4 months ago

    I second the inotifywait method. Thats currently how I look for new appimages and auto add them to my menus. You can tell it a directory like what you are looking for, and have it only trigger on new files, edited files and deleted files, then have it run an external script when it does.

  • source
  • [–] 5 points 4 months ago (5 children)

    If you want simple, just commit unconditionally every x minutes with cron. It won't do anything if there's nothing to commit

  • source
  • hideshow 5 child comments
  • [–] 2 points 4 months 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.

  • source
  • parent
  • [+] -12 points 4 months ago (3 children)
  • [–] 6 points 4 months ago (2 children)

    Before showing your terrible understanding of git, try it. If you run 'git commit -m auto foo' and foo has not changed, git will not do anything. It's a no-op. So there is no downside and is very simple. Additionally, it returns 1, so if you do 'git commit -m auto foo && git push', it won't do the push.

    But thanks for playing

  • source
  • parent
  • hideshow 2 child comments
  • [–] 2 points 4 months ago

    IDEs like JetBrains use inotify to monitor filesystem changes

  • source
  • [–] 1 point 4 months ago

    INotify sounds best. Otherwise watch -n 10 git commit -am "auto" && git push. Git dont allow empty commits.

  • source
  • [–] 1 point 4 months ago

    What are you doing Hermes?

  • source