Operating System - HP-UX
1833821 Members
2591 Online
110063 Solutions
New Discussion

Trimming inetd logging log regularly

 
SOLVED
Go to solution
Victor_5
Trusted Contributor

Trimming inetd logging log regularly

I want to enable inetd logging:
vi /etc/rc.config.d/netdaemons
export INETD_ARGS=-1
inetd -c

After that, I need to trim the log file regularly, I know I can do it through SAM, my question is what is the default log and how can I do it if I use cron job? Thanks.
6 REPLIES 6
Jeff Schussele
Honored Contributor

Re: Trimming inetd logging log regularly

Hi Victor,

Default log is the standard syslog.log file but can be controlled & tailored by the conf file for the syslog - /etc/syslog.conf

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
James R. Ferguson
Acclaimed Contributor

Re: Trimming inetd logging log regularly

Hi Victor:

Connection logging occurs to '/var/adm/syslog/syslog.log'.

Regards!

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

Re: Trimming inetd logging log regularly

Depending on how thorough you want your "cleanup" script in the cron to be, the script should in essence do this .. ( I'm asuming you want to keep a compress copy of the syslog.log file )

# /sbin/init.d/syslogd stop
==> Stop syslogd
# cp /var/adm/syslog/syslog.log /var/adm/syslog/syslog.old
# compress /var/adm/syslog/syslog.old
==> You want to make sure /var has enough space, it not copy it to other location.
# > /var/adm/syslog/syslog.log
==> Zero'ed out syslog.log
# /sbin/init.d/syslogd start
==> Start syslogd

In root's cron file it would look like this ..
(say you want to do this every Fri at 0101hrs)
# crontab -e
==> edit crontab file
# crontab -l
01 01 * * 5 /usr/bin/cleanup

Scott Van Kalken
Esteemed Contributor

Re: Trimming inetd logging log regularly

here's one that I use for most of my log files.
Scott Van Kalken
Esteemed Contributor

Re: Trimming inetd logging log regularly

...and the correspondig config file
Victor_5
Trusted Contributor

Re: Trimming inetd logging log regularly

Thanks, all! I will have a try and assign points soon.