summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/ftpsync13
-rw-r--r--etc/ftpsync.conf.sample5
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"