diff options
author | Joerg Jaspert <joerg@debian.org> | 2008-11-08 10:49:34 +0100 |
---|---|---|
committer | Joerg Jaspert <joerg@debian.org> | 2008-11-08 10:49:34 +0100 |
commit | 33c9af5e463538b72024009c0b35aad3dfef487d (patch) | |
tree | 8c0344e1f1f1c8c170a00da612c32b21110667cf | |
parent | 054d747167dfd1cc344fb0f597e5e46506846bff (diff) |
ftpsync
make it possible to send full rsync logs too. default is off
Signed-off-by: Joerg Jaspert <joerg@debian.org>
-rwxr-xr-x | bin/ftpsync | 13 | ||||
-rw-r--r-- | etc/ftpsync.conf.sample | 5 |
2 files changed, 15 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"} diff --git a/etc/ftpsync.conf.sample b/etc/ftpsync.conf.sample index f2b7dd5..e822bdb 100644 --- a/etc/ftpsync.conf.sample +++ b/etc/ftpsync.conf.sample @@ -35,6 +35,11 @@ ## Everything else will only send mails if a mirror sync fails #ERRORSONLY="true" +## If you want the logs to also include output of rsync, set this to true. +## Careful, the logs can get pretty big, especially if it is the first mirror +## run +#FULLLOGS="false" + ## We do create three logfiles for every run. To save space we rotate them, this ## defines how. #SAVELOG="savelog -t -c 14" |