1848519 Members
5968 Online
104031 Solutions
New Discussion

syslog.log reset

 
SOLVED
Go to solution
YLTan
Frequent Advisor

syslog.log reset


is there a command to reset the syslog.log to zero and roll its content to OLDsyslog.log while server is up and without rebooting the server.

"mv syslog.log to OLDsyslog.log; touch syslog.log" may cause miss logging some entries.

tyl
4 REPLIES 4
Rajeev  Shukla
Honored Contributor
Solution

Re: syslog.log reset

Hi,
If you want to do it online without rebooting the systems, you'll anyway loose some entries if your system is too busy.

And other thing i would suggest that doing manually is usr /sbin/init.d/syslogd file to stop and start the syslogd daemon. This will move the syslog.log to OLDsyslog.log

Cheers
Rajeev
T G Manikandan
Honored Contributor

Re: syslog.log reset

you can do a

#cp syslog.log syslog.log151203
#cat /dev/null >./syslog.log
Michael Tully
Honored Contributor

Re: syslog.log reset

Try this:

# /sbin/init.d/syslogd stop
# mv /var/adm/syslog/syslog.log /var/adm/syslog/syslog.OLD
# /sbin/init.d/syslogd start
Anyone for a Mutiny ?
Michael Tully
Honored Contributor

Re: syslog.log reset

Try this:

# /sbin/init.d/syslogd stop
# mv /var/adm/syslog/syslog.log /var/adm/syslog/syslog.OLD
# touch /var/adm/syslog/syslog
# chown root:root /var/adm/syslog/syslog.log
# chmod 644 /var/adm/syslog/syslog.log
# /sbin/init.d/syslogd start
ignore my previous one, I hit the button too early ...
Anyone for a Mutiny ?