summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorJoerg Jaspert <joerg@debian.org>2008-11-08 10:49:34 +0100
committerJoerg Jaspert <joerg@debian.org>2008-11-08 10:49:34 +0100
commit33c9af5e463538b72024009c0b35aad3dfef487d (patch)
tree8c0344e1f1f1c8c170a00da612c32b21110667cf /bin
parent054d747167dfd1cc344fb0f597e5e46506846bff (diff)
ftpsync
make it possible to send full rsync logs too. default is off Signed-off-by: Joerg Jaspert <joerg@debian.org>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ftpsync13
1 files changed, 10 insertions, 3 deletions
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"}