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!

Clearing /usr/adm/syslog

Status
Not open for further replies.
Mar 19, 2004
35
US
SCO Openserver 5.0.x
The /usr/adm/syslog file has grown to be 200MB.

I try to zero it out with this command:
# >syslog

Initially it shows to be zero bytes, but shortly after that it goes back to 200MB. I assume the O/S is keeping that file open? How to properly clear this file? Thanks!
 
Do it in single user mode.
Or perhaps this ?
rm /var/adm/syslog
>/var/adm/syslog
chown 0:0 /var/adm/syslog
kill -HUP `cat /etc/syslog.pid`

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
From the manual, just did it and works fine.
Code:
Clearing system log files from the command line
To clear a log file and retain the file permissions: 


Copy the file to a new filename. For example: 

cp /usr/adm/messages /usr/adm/messages.old 


Clear the file with one of these commands: 

Bourne or Korn shell: 

> /usr/adm/messages 


C shell: 

cat /dev/null > /usr/adm/messages
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top