From 327e901527f7581467162a832e7a6b01fe9c51cf Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 24 Aug 2007 15:44:00 +0200 Subject: [PATCH] Export logfile name, output errors on stderr --- tools/ccollect-logwrapper.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/ccollect-logwrapper.sh b/tools/ccollect-logwrapper.sh index 6142385..c2b0c2e 100755 --- a/tools/ccollect-logwrapper.sh +++ b/tools/ccollect-logwrapper.sh @@ -15,7 +15,7 @@ CDATE="date +%Y%m%d-%H%M" we="$(basename $0)" pid=$$ -logfile="${logdir}/$(${CDATE}).${pid}" +export ccollect_logfile="${logdir}/$(${CDATE}).${pid}" # use syslog normally # Also use echo, can be redirected with > /dev/null if someone cares @@ -30,17 +30,17 @@ _echo() # exit on error _exit_err() { - _echo "$@" + _echo "$@" >&2 rm -f "${TMP}" exit 1 } # put everything into that specified file _echo "Starting with arguments: $@" -touch "${logfile}" || _exit_err "Failed to create ${logfile}" +touch "${ccollect_logfile}" || _exit_err "Failed to create ${ccollect_logfile}" # First line in the logfile is always the commandline -echo ccollect.sh "$@" > "${logfile}" 2>&1 -ccollect.sh "$@" >> "${logfile}" 2>&1 +echo ccollect.sh "$@" > "${ccollect_logfile}" 2>&1 +ccollect.sh "$@" >> "${ccollect_logfile}" 2>&1 _echo "Finished."