Operating System - HP-UX
1847006 Members
4903 Online
110257 Solutions
New Discussion

Re: create new syslog.log

 
RNC
Frequent Advisor

create new syslog.log

Hello all,

I have the syslog.log file, but I want to rotate the file. I want to create the OLDsyslog.... and the syslog.log new.

Some one know how to do it?

Thanks in advanced
4 REPLIES 4
Victor BERRIDGE
Honored Contributor

Re: create new syslog.log

Hi

/sbin/init.d/syslogd stop
/sbin/init.d/syslogd start



All the best
Victor
Muthukumar_5
Honored Contributor

Re: create new syslog.log

Just do as,

cp /var/adm/syslog/syslog.log /var/adm/syslog/OLDsyslog.log
> /var/adm/syslog/syslog.log

or restart syslogd in /sbin/init.d/

hth.
Easy to suggest when don't know about the problem!
RNC
Frequent Advisor

Re: create new syslog.log

Thanks. Lets is ok like victor tell me.
Alessandro Pilati
Esteemed Contributor

Re: create new syslog.log

You can use either a this Logrotate software

http://hpux.connect.org.uk/hppd/hpux/Sysadmin/logrotate-2.5/

or use some procedures that you can find in this links:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=57218

Consider also that this command
sbin/init.d/syslogd stop & /sbin/init.d/syslogd

will rotate the syslog.log file; for example you could use a cron job that every 10 mins checks the syslog file lenght and then rotates the log.

In attachment I put a script of the great Bill Hassel to manage log rotation ( thank you Bill for your teachments! )

Hope this helps,
Alex
if you don't try, you'll never know if you are able to