Operating System - HP-UX
1833471 Members
2603 Online
110052 Solutions
New Discussion

redirected log Growing...

 
SOLVED
Go to solution
joe_91
Super Advisor

redirected log Growing...

Team:

We have redirected certain application specific messages to a different log file (in /etc/syslog.conf) Now syslog.log is fine. But the new user.log is growing. How do we trim this on regular basis? also stopping syslogd an restarting would not affect user.log is it? it only seems to change syslog.log to OLDsyslog.log

Thanks
Joe.
4 REPLIES 4
jim bidebo
Regular Advisor

Re: redirected log Growing...

have a look at http://hpux.connect.org.uk/hppd/hpux/Sysadmin/logrotate-2.5/

would be enogh, opensource rules =)
James R. Ferguson
Acclaimed Contributor
Solution

Re: redirected log Growing...

Hi:

You can copy (cp) your logfile, naming it whatever you want and then null it by redirecting /dev/null into it.

# cp mylog mylog.old
# cat /dev/null > mylog

Regards!

...JRF...
S.K. Chan
Honored Contributor

Re: redirected log Growing...

A few ways you can tackle this. From the application side , can you limit the size of the logfile ? But I suppose this is not what you want to do. If this is the only log file that you want to trim (the rest of the system logfiles are behaving well) you probably just want to write a script and stick it in cron and "zero'ed" the log file once a week maybe. If you want to take care of other logs as well then getting a 3rd party tool like "logrotate" is a good choice.
MANOJ SRIVASTAVA
Honored Contributor

Re: redirected log Growing...

Hi Joe


What we essentially do is to run a cront job which move appends the syslog to a file everty day and mvoe it to the a differnt place and then clean the syslog file , this helps in archiving the stuff for one month period in case something is required for a older date

0 0 * * * /usr/local/adm/test

and test has

date >> archive file
cat /var/adm/syslog/syslog.conf >> archive file
cat > /dev/null /var/adm/syslog


Manoj Srivastava