LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   logrotation (https://www.linuxquestions.org/questions/linux-general-1/logrotation-44931/)

cuss 02-11-2003 09:41 AM

logrotation
 
Hi,

Here is an entry in my logrotate.conf file:

# RPM packages drop log rotation information into this directory
include /etc/logrotate.d

I put five different scripts into /etc/logrotate.d/syslog. Now I am wondering if I have to add an entry into my logrotate.conf file like the one below (3rd line down) for this to work:

# RPM packages drop log rotation information into this directory
include /etc/logrotate.d
include /etc/logrotate.d/syslog

In /etc/logrotate.d/syslog by default there was this entry below:

/var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron {
sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
endscript
}

The log files mentioned above are rotating properly without an entry in logrotate.conf (inlcude /etc/logrotate.d/syslog). I'm just not sure if i'm not seeing any rotation yet because the 5 logfiles i created are set for monthly rotation. That makes sense to me but confirmation would be nice. Would it be easier to put the 5 scripts i created right into logrotate.conf? Below is one of my scripts.

/var/log/syslog {
monthly
rotate 12
postrotate
/usr/bin/killall -HUP syslogd
endscript
}

Also, are there specific permissions which i might have to set on /etc/logrotate.d/syslog?

Thanks,

bulliver 02-16-2003 01:37 PM

Quote:

The log files mentioned above are rotating properly without an entry in logrotate.conf
Well, you can see the "include" statement which makes logrotate read /etc/logrotate.d/syslog, which in essence extends the main .conf file. You can put your scripts in syslog if you want, or put them in the main conf file. The syslog is just a way to seperate the configuration of the system logs.

cuss 02-17-2003 09:27 AM

What I've done is put the scripts in /etc/logrotate.d. Now I have /etc/logrotate.d/syslog as well as /etc/logrotate.d/script 1......script 5 for a total of 6 scripts in /etc/logrotate.d. I assume this should also work because of the "include" statement in logrotate.conf. I've taken out the statement /etc/logrotate.d/syslog since I moved my scripts out of this location.

bulliver 02-17-2003 01:18 PM

That will work fine, but it does create an unecessary amount of files, why not just type your scripts directly into one of the conf files?


All times are GMT -5. The time now is 09:52 AM.