rm -f ${LOCK_ACCEPTED}
}
+########################################################################
+# the actual dinstall functions follow #
+########################################################################
+
# Setup the notice file to tell bad mirrors they used the wrong time
function notice() {
rm -f "$NOTICE"
}
function logstats() {
- $masterdir/tools/logs.py "$LOGFILE"
+ $masterdir/tools/logs.py "$1"
+}
+
+# save timestamp when we start
+function savetimestamp() {
+ NOW=`date "+%Y.%m.%d-%H:%M:%S"`
+ echo ${NOW} > "${dbdir}/dinstallstart"
+}
+
+function renamelogfile() {
+ if [ -f "${dbdir}/dinstallstart" ]; then
+ RENAMETO=$(cat "${dbdir}/dinstallstart")
+ mv "$LOGFILE" "$logdir/dinstall_${RENAMETO}.log"
+ logstats "$logdir/dinstall_${RENAMETO}.log"
+ bzip2 -9 "$logdir/dinstall_${RENAMETO}.log"
+ else
+ error "Problem, I don't know when dinstall started, unable to do log statistics."
+ NOW=`date "+%Y.%m.%d-%H:%M:%S"`
+ mv "$LOGFILE" "$logdir/dinstall_${NOW}.log"
+ bzip2 -9 "$logdir/dinstall_${NOW}.log"
+ fi
}
########################################################################
touch "${LOCK_BRITNEY}"
+GO=(
+ FUNC="savetimestamp"
+ TIME=""
+ ARGS=""
+ ERR="false"
+)
+stage $GO
+
GO=(
FUNC="notice"
TIME=""
exec > /dev/null 2>&1
+cat "$LOGFILE" | mail -s "Log for dinstall run of ${NOW}" cron@ftp-master.debian.org
+
GO=(
- FUNC="logstats"
+ FUNC="renamelogfile"
TIME=""
ARGS=""
- ERR=""
+ ERR="false"
)
stage $GO
-cat "$LOGFILE" | mail -s "Log for dinstall run of ${NOW}" cron@ftp-master.debian.org
-
-savelog -c ${LOGROTATE} -j "$LOGFILE"
# Now, at the very (successful) end of dinstall, make sure we remove
# our stage files, so the next dinstall run will do it all again.