Technical article 127077

How can I truncate the syslog file?

OpenServer 6.0.0OpenServer 5.0.7UnixWare 7.1.4

Written

Problem

My 'syslog' file is too big, how can I truncate this?

Solution

You may wish to copy the old syslog first or, if disk space is an issue, use your preferred compression tool to take a copy:

# cp /usr/adm/syslog /usr/adm/syslog.old
or:
# gzip -9 -c /usr/adm/syslog > /usr/adm/syslog.old.gz

If you would like to truncate your syslog file do the following:

a) Truncate the file to 0 bytes in size using:

# > /usr/adm/syslog
b) Restart the syslog daemon using:
# kill -1 `cat /etc/syslog.pid`

c) To verify that all is working run:

# logger "Test"

d) and then check the end of the log file to see that the "Test" text appears in the log:

# tail /usr/adm/syslog

See also

TA#125345, "syslog(3G) messages that I wish to send to a specific logfile or host also get logged to /var/adm/log/osmlog on UnixWare 7"

From the Xinuos technical article database, record 127077. Reproduced with permission. The original is at www.sco.com/ta/127077, which is reachable but blocked from search engines.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.