LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-11-2003, 10:41 AM   #1
cuss
Member
 
Registered: Dec 2002
Posts: 63

Rep: Reputation: 15
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,
 
Old 02-16-2003, 02:37 PM   #2
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
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.
 
Old 02-17-2003, 10:27 AM   #3
cuss
Member
 
Registered: Dec 2002
Posts: 63

Original Poster
Rep: Reputation: 15
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.
 
Old 02-17-2003, 02:18 PM   #4
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
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?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
edited logrotation cyberpunx Linux - Software 0 09-06-2005 02:55 PM
postgres+syslogng+logrotation problem emailssent Linux - General 8 04-11-2005 06:27 PM
logrotation doesn't working properly emailssent Linux - Networking 1 03-02-2005 11:54 AM
customizing Debian (deluser, logrotation, etc) markus1982 Linux - Distributions 0 05-25-2003 05:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration