From e4969a390ae2e60c4597a3422ec5e04f8357b1ff Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 20 Aug 2007 17:45:06 +0200 Subject: [PATCH] Update changelog, documentation and fix ccollect-logwrapper.sh --- doc/CHANGES | 1 + doc/ccollect.text | 2 +- tools/ccollect-logwrapper.sh | 13 +++++++++---- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/doc/CHANGES b/doc/CHANGES index b336b8d..16af523 100644 --- a/doc/CHANGES +++ b/doc/CHANGES @@ -1,6 +1,7 @@ 0.6 to 0.6.1: * Added check for destination_base in add_ccollect_source.sh * Add support for -V and --version + * Added ccollect-logwrapper.sh (and a manpage ;-) 0.5.2 to 0.6: * Always print return code of rsync diff --git a/doc/ccollect.text b/doc/ccollect.text index 5a29bd8..968fe33 100644 --- a/doc/ccollect.text +++ b/doc/ccollect.text @@ -1,7 +1,7 @@ ccollect - Installing, Configuring and Using ============================================ Nico Schottelius -0.6, for ccollect 0.6, Initial Version from 2006-01-13 +0.6, for ccollect 0.6 - 0.6.1, Initial Version from 2006-01-13 :Author Initials: NS diff --git a/tools/ccollect-logwrapper.sh b/tools/ccollect-logwrapper.sh index f2feb0c..6142385 100755 --- a/tools/ccollect-logwrapper.sh +++ b/tools/ccollect-logwrapper.sh @@ -12,7 +12,7 @@ LOGCONF=$CCOLLECT_CONF/logwrapper logdir="${LOGCONF}/destination" CDATE="date +%Y%m%d-%H%M" -we="$(basenae $0)" +we="$(basename $0)" pid=$$ logfile="${logdir}/$(${CDATE}).${pid}" @@ -21,8 +21,9 @@ logfile="${logdir}/$(${CDATE}).${pid}" # Also use echo, can be redirected with > /dev/null if someone cares _echo() { - logger "${we}-${pid}: $@" - echo "${we}-${pid}: $@" + string="${we} (${pid}): $@" + logger "${string}" + echo "${string}" } @@ -37,5 +38,9 @@ _exit_err() # put everything into that specified file _echo "Starting with arguments: $@" touch "${logfile}" || _exit_err "Failed to create ${logfile}" -ccollect.sh "$@" > "${logfile}" 2>&1 + +# First line in the logfile is always the commandline +echo ccollect.sh "$@" > "${logfile}" 2>&1 +ccollect.sh "$@" >> "${logfile}" 2>&1 + _echo "Finished."