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

Reply via email to