Apart from creating a 2nd script which would check the time of the last commit and then run the main script and which would be too complex of a solution, is there a simpler one?
2 Answers
Write a git post-commit hook that contains a call to at time+60
-
-
3@Oaemirami
at
is a command that executes another specified command at a given time (+60 seconds in this case).– user335605Jun 16, 2018 at 19:15 -
1
-
2
-
The request was for script on "a server". If this is the host running the remote repo, this would be the
post-receive
hook. Jun 17, 2018 at 1:23
Besides at
(which may or may not be available to the user under which the hook runs), you can also do something like that from the appropriate hook, probably post-receive
):
( sleep 1m ; /usr/local/bin/do_something ) &