Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

creating new syslog at boot

Status
Not open for further replies.

bi

Technical User
Apr 13, 2001
1,552
US
Is there an easy way to move the current syslog file to a new file and create a new syslog file every time the system boots? HP does this on every boot. Sun does it once the messages file gets to a certain size (or maybe it's age). But AIX's syslog just gets bigger and bigger. I'd like it to be automatic so the sys admins don't even have to think about it and I'd like to keep two generations of the syslog file.

Any suggestions? Thanks.
 
Use a script to copy it and include it in inittab?

Not tested, I have to say, and it's a Friday afternoon.....
 
from syslogd man pages:

5. To log all facility messages at the debug level or above to the file /tmp/syslog.out, and have the file rotated when it gets larger then 500 kilobytes or if a week passes, limit the number of rotated files to 10, use compression and also use /syslogfiles as the archive directory, type:

*.debug /tmp/syslog.out rotate size 500k time 1w files 10 compress archive /syslogfiles

Just insert something like that in your syslog.conf file.
 
clund, now I'm embarassed I asked. I had always assumed there was no way to do it without scripting. AND if I'd read the syslog.conf file I wouldn't have had to ask either. Thank you.

And Ken, you're right. It is Friday. I was hoping some kind soul would have done my work for me and given me a debugged script!

Thanks to both of you. [blush]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top