help run some trigger programs in the background

This commit is contained in:
Sitaram Chamarty 2012-11-10 14:09:26 +05:30
parent d491b5384f
commit c03d107bac

17
src/triggers/bg Executable file
View file

@ -0,0 +1,17 @@
#!/bin/bash
# quick and dirty program to background any of the triggers programs that are
# taking too long. To use, just replace a line like
# 'post-compile/update-gitweb-access-list',
# with
# 'bg post-compile/update-gitweb-access-list',
# We dump output to a file in the log directory but please keep in mind this
# is not a "log" so much as a redirection of the entire output.
echo `date` $GL_TID "$0: $@" >> $GL_LOGFILE.bg
path=${0%/*}
script=$path/$1; shift
( ( $script "$@" < /dev/null >> $GL_LOGFILE.bg 2>&1 & ) )