4
2
I am looking for a tool to keep a task alive (restarting if necessary) for a specified amount of time (in seconds), and then kill it and stop. For example: keep_for 3600 rsync foo bar:faz
should for try to synchronize a directory (restarting rsync in case of f.e. dropped connection), but explicitly kill rsync and stop respawning it after an hour.
I tried to write a shell script for that, but it was surprisingly difficult to write, with lots of edge cases (like child process not getting killed, or shell escaping issues). So... maybe there already is a tool for that?
If I understand the manual correctly, this is a planned feature... also I think that for an ad-hoc command it is slightly too big :-) Still, thank you for suggestion. – liori – 2010-05-07T22:09:25.590