I'd like have automatic update of my gtags, but only when the system is idle.
To achieve this, I'm using
iupdate to watch over the interesting parts of my source folder. But I have a problem with the "idle" part: I know that the
batch command can run jobs when the load drops below 1.5 (or a configured value). But it may happen that
batch multiple times before the job is executed which would lead to multiple gtags updates.
Of course I could create some lockfile and start
batch only if it wasn't called before.
But is there some more standard method? I'm hoping for something like