On Mon, 5 Jul 1999, Wes wrote:

> I was wondering if it would be possilbe to set up a cron job to
> 
> 1. email the messages, syslog and xferlog once a month to a seperate email
> either as an attachment or as the content of a email

0 0 * * *    cat /var/adm/messages | mail -s "messages file" [EMAIL PROTECTED]
> 
> 2. Archive the previous months message. syslog and xferlog, something along
> the lines of having cron rename them to messages-7-99, etc. and start new
> log files
> 
make a script like

#!/bin/sh
suffix=`date +%m-%Y`
newname=`echo /var/adm/messages-$suffix`
mv /var/adm/messages $newname
echo >/var/adm/messages
killall -HUP syslogd        # to make syslogd reopen its files

Run this script with a cron entry

> 3. Have it delete the previous months log files.

see 2.
> 
> Any advice or tips on where to look to start setting this up would be very
> helpfull
> 
> Thanks
> Wes...
> 
> 

Frank

HI! I'm a .signature virus! cp me into your .signature file to help me spread!

Reply via email to