Stu,
You have correctly rebuild the file which is the normal stumbling block.
Anyway, it may be a simply case of restarting syslog (/etc/init.d/syslog) at
the end of your script.
Rgds
Phil
----- Original Message -----
From: Stuart Bird
To: Plug
Sent: Wednesday, November 15, 2006 2:22 PM
Subject: [Peterboro] Log Control Script
Hi All
I have written the below script to help tame my server logs.
#!/bin/bash
#Compress Log Files
gzip /var/log/messages
#Move Gzipped Files to storage folder
mv /var/log/messages.gz /root/logs/system
#Blat log files
cat /dev/null > /var/log/messages
As you can see I have only included /var/log/messages at this time.
When I run this script it seems to work, with one major problem. After
running the script the messages file will no longer populate with data until
reboot the system. I was hoping to run this as a cron job, but can’t if I have
to reboot each time.
Have I got something wrong, or do I need to add something to stop this
happening.
Stu
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.409 / Virus Database: 268.14.5/534 - Release Date: 14/11/2006
------------------------------------------------------------------------------
_______________________________________________
Peterboro mailing list
[email protected]
https://mailman.lug.org.uk/mailman/listinfo/peterboro
_______________________________________________
Peterboro mailing list
[email protected]
https://mailman.lug.org.uk/mailman/listinfo/peterboro