[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] little bug (help!)



On Sun, Jun 06, 1999 at 12:59:26PM +0300, Martin-Eric Racine wrote:
> During the NMD build process, I'm trying to implement various
> functionalities that were not found in KGMD.  One of these is
> log rotation.  I have mae a little bourne script for this:
> 
> #!/bin/sh
> #
> # ROT_LOG.SH  every Sunday @ 10:01
> 

Please insert these lines (won't fix this problems but future ones):
# Avoid NLS nuisances.
LANG=C
LANGUAGE=C
export LANG LANGUAGE
set -x  # Debug script.

> DATE=`date`
> PID=`cat /var/run/syslog.pid`
> 
> echo "* * * * * Recycling system logs * * * * *" > /dev/log
> mv /var/log/* /var/tmp/

Why do you move the logs to /var/tmp?  I would prefer to rename them
in the directory they were (for security reasons).

> touch /var/log/wtmp 
> touch /var/log/lastlog
> echo -e "FTP log recycled on" $DATE". \n" > /var/log/ftp.log
> sleep 1
> kill -HUP $PID

Try to insert "set -x" somewhere above to see what actually happens in the
shell script.  Maybe "$PID" expands to something wrong.

Ciao

Guido
-- 
http://stud.uni-sb.de/~gufl0000
mailto:gufl0000@stud.uni-sb.de