1) As configurated, this file manages logs system files, correct?
No, only wtmp will be rotated by default. Take a look in /etc/logrotate.d what else might get rotated.
Quote:
Originally Posted by idro
2) Now, I have to manage log files (called monitoring.log) produced by a custom script created by myself (monitoring.sh).
I'd want this log be emptied everyday, at a certain hour, and old log files be archived everyday.
The script and log path is /root.
What does the very first line in your logrotate.conf say? Did you read it? Did you understand it? If not, post concrete questions, but don't ask us to do your work.
I read documentation e I've just done my script to handle my monitoring log files, that it's simply as follow:
This times I hope not to make a wrong question, but I didn't really understand how to synchronize my monitoring.sh custom script (see post below) and the actions of logrotate on monitoring.log.
Maybe logrotate starts at the end of monitoring.sh, or not?
THX
Last edited by pludi; 03-25-2010 at 08:53 AM..
Reason: code tags, please!
First, drop the endscript directive. It's only valid if you've got a prerotate or postrotate somewhere in there.
Second, it depends on how logging is implemented in your script to say how to best inform it of a rotation. If you're just logging with lines like
or similar, you don't have to do anything. If your script only runs at intervals and probably won't cross times with logrotate, you don't have to do anything.
If, however, your script runs most of the time, and opens a file descriptor for the log at the beginning, you'll probably have to close and re-open that fd. The easiest way would be a trap on SIGHUP, and an appropriate postrotate script.
Hi,
I've installed Solaris 11.3(live media) and configured DNS. Everytime I reboot the server, resolv.conf got deleted and it created a new nsswitch.conf.
I used below to configure both settings:
# svccfg -s dns/client
svc:/network/dns/client> setprop config/nameserver = (xx.xx.xx.aa... (1 Reply)
Hello all,
Newbie here.
I'm currently tasked with updating rsyslog.conf and auditd.conf on a large set of servers. I know the exact logging configurations that I want to enable. I have updated both files on on a server and hope to use the updated files as a template for the rest of the... (3 Replies)
Hi Admins.
I have installed logrotate rpm on Aix 6.1.
After the installation of rpm, I don't find /etc/logrotate.conf file and /etc/logrotate.d dir .
The config file is located in /opt/freeware/etc/logrotate.conf.
When I ran
logrotate -v /opt/freeware/etc/logrotate.conf
I get below... (2 Replies)
I have written script which is working in Home directory perfectly and also compressing log files and rotating correctly. But, when i try to run script for /var/log/ i am able to get compressed log files but not able to get rotation of compressed log files. Please suggest.
I am using below command... (5 Replies)
Hi there,
I want to rotate the logfiles which are located in /var/log/jboss/tomcat*
so I have created a file named as 'tomat' in /etc/logrotate.d/tomcat with the following content.
# cat /etc/logrotate.d/tomcat
/var/log/jboss/tomcat_access_log*.log {
daily
nocreate
... (2 Replies)
HI,
I want a help for Configuring snmpd.conf and snmptrapd.conf (i.e Configuring SNMP)
for receiving
TRAPS in my networks. I am using RHEL4.0 OS.
Please tell me How I can configure above two files in a proper way and at an
advanced level.
Especially I am getting... (2 Replies)
Hi,guys:
recently,i am puzzled by a question .when i create a new file named by /etc/logrotate.d/debug. The cont. is listed as follow:
/var/log/debug {
rotate 3
missingok
notifempty
size=2k
prerotate
/bin/kill -HUP `cat... (0 Replies)
I changed the logrotate.conf file to make a new log file to be automatically rotated daily. But after a night, I have not seen the rotated file.
When does this rotation happen? I mean what is the exact time?
In addition, do I have to restart what deamon to make the change take effect? (10 Replies)