From 33c9af5e463538b72024009c0b35aad3dfef487d Mon Sep 17 00:00:00 2001 From: Joerg Jaspert Date: Sat, 8 Nov 2008 10:49:34 +0100 Subject: ftpsync make it possible to send full rsync logs too. default is off Signed-off-by: Joerg Jaspert --- bin/ftpsync | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'bin') diff --git a/bin/ftpsync b/bin/ftpsync index 88ce6b2..b251654 100755 --- a/bin/ftpsync +++ b/bin/ftpsync @@ -32,7 +32,7 @@ BASEDIR=${BASEDIR:-"${HOME}"} # Script version. DO NOT CHANGE, *unless* you change the master copy maintained # by Joerg Jaspert and the Debian mirroradm group. # This is used to track which mirror is using which script version. -VERSION="3.1415926" +VERSION="42" # Source our common functions . "${BASEDIR}/etc/common" @@ -105,7 +105,12 @@ cleanup() { fi if [ "x${ERRORSONLY}x" = "xfalsex" ]; then # And the normal log - mail -e -s "[${PROGRAM}@$(hostname -s)] archive sync finished on $(date +"%Y.%m.%d-%H:%M:%S")" ${MAILTO} < ${LOG} + MAILFILES="${LOG}" + if [ "x${FULLLOG}x" = "xtruex" ]; then + # Someone wants full logs including rsync + MAILFILES="${MAILFILES} ${LOGDIR}/rsync-${NAME}.log" + fi + cat ${MAILFILES} | mail -e -s "[${PROGRAM}@$(hostname -s)] archive sync finished on $(date +"%Y.%m.%d-%H:%M:%S")" ${MAILTO} fi fi @@ -113,7 +118,7 @@ cleanup() { ${SAVELOG} "${LOGDIR}/rsync-${NAME}.error" ${SAVELOG} "$LOG" > /dev/null - rm -f "${LOCK}"; + rm -f "${LOCK}" } # Check rsyncs return value @@ -223,6 +228,8 @@ else fi # Want errors only or every log? ERRORSONLY=${ERRORSONLY:-"true"} +# Want full logs, ie. including the rsync one? +FULLLOGS=${FULLLOGS:-"false"} # How to rotate our log SAVELOG=${SAVELOG:-"savelog -t -c 14"} -- cgit v1.2.3