Log rotation (unwanted.log, tally.unwanted)
Katsuhiro Kondou
Katsuhiro_Kondou at isc.org
Fri Jul 13 15:58:50 UTC 2001
In article <9i1s9n$lgs$1 at krell.zikzak.de>,
Bettina Fink <laura at hydrophil.de> wrote;
} > } tally.unwanted is still in scanlogs, so why not simply bring it back?
} >
} > Ok, I'll incorporate tally.unwanted again, if no one objects.
}
} That would be great, thx!
I found where the problem is, while I'm slowly :) working this.
tally.unwanted is NOT needed. innreport DOES take that part.
The problem is that old unwanted.log is moved to pathlog/OLD
before innreport runs. Innreport believes the old path of
unwanted.log is pathlog/unwanted.log. Attached should work,
and please tell me if so. I'll commit then.
--
Katsuhiro Kondou
Index: scripts/scanlogs.in
===================================================================
RCS file: /home/kondou/news/inn/repository/inn/scripts/scanlogs.in,v
retrieving revision 1.3
diff -u -r1.3 scanlogs.in
--- scripts/scanlogs.in 2000/12/05 02:48:46 1.3
+++ scripts/scanlogs.in 2001/07/13 15:55:16
@@ -164,6 +164,10 @@
${SYSLOG_ERR})
mv ${F}.old ${OLD}/${BASE}
;;
+ ${UNWANTED_LOG})
+ ## Innreport assumes where unwanted.log exists, so leave it
+ ## and process later.
+ ;;
*)
if [ -f ${F}.old ]; then
mv ${F}.old ${OLD}/${BASE}
@@ -241,6 +245,16 @@
echo ''
fi
rm -f ${OLD_LOG} ${OLD_SYSLOG}
+if ${ROTATE} ; then
+ BASE=`basename ${UNWANTED_LOG}`
+ if [ -f ${UNWANTED_LOG}.old ]; then
+ mv ${UNWANTED_LOG}.old ${OLD}/${BASE}
+ else
+ rm -f ${OLD}/${BASE}
+ cp ${UNWANTED_LOG} ${OLD}/${BASE}
+ chmod 0660 ${OLD}/${BASE}
+ fi
+fi
OLD_SYSLOG=${OLD}/${EXPLOG}.0
rm -f ${EXPLOG}
More information about the inn-workers
mailing list