LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 12-15-2004, 12:05 PM   #1
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
rotate apache logs


I have a default Slackware 10 (stable) installation. I created a file 'apache' in /etc/logrotate.d/ with the following contents
Code:
 /var/log/apache/access_log /var/log/apache/error_log {
    missingok
    daily
    sharedscripts
    postrotate
        /usr/sbin/apachectl graceful 2>/dev/null || true
    endscript
}
When I run '/usr/sbin/logrotate -v /etc/logrotate.conf', it tells me that the apache logs do not need rotating. What's wrong?
 
Old 12-15-2004, 12:59 PM   #2
sigsegv
Senior Member
 
Registered: Nov 2004
Location: Third rock from the Sun
Distribution: NetBSD-2, FreeBSD-5.4, OpenBSD-3.[67], RHEL[34], OSX 10.4.1
Posts: 1,197

Rep: Reputation: 46
You can add a -f to force the rotation
 
Old 12-15-2004, 01:46 PM   #3
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Original Poster
Rep: Reputation: 165Reputation: 165
Thank you for the reply. I did add a '-d -f' and it seems that the rotation would go through, but what's holding it up if I don't force it?
 
Old 12-15-2004, 02:02 PM   #4
tank728
Member
 
Registered: Sep 2003
Posts: 142

Rep: Reputation: 16
I am assuming that you have that machine
running 24/7 since it is a web server. Slack
runs logrotate once a day via a cron job.

folder for daily cron job to run
/etc/cron.daily

acctually script that is run
/etc/cron.daily/logrotate

Good Luck

-tank
 
Old 12-15-2004, 02:58 PM   #5
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Original Poster
Rep: Reputation: 165Reputation: 165
Yes, the computer runs 24/7. There's an entry for the apache logs in /var/lib/logrotate/status, but the logs aren't being rotated.
 
Old 12-15-2004, 09:36 PM   #6
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Original Poster
Rep: Reputation: 165Reputation: 165
In case anyone is interested, I needed to wait for the second daily cron cycle before logging could begin. The first cron cycle creates a dated entry for the apache logs in /var/lib/logrotate/status, and the following day's cron checks this file and sees that it's time to rotate the logs.

Last edited by Berhanie; 12-15-2004 at 09:44 PM.
 
  


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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
About Apache Logs SiLiCoN Linux - Networking 1 05-26-2005 10:34 AM
Apache Logs Valso Linux - Software 2 11-05-2004 03:13 PM
(also) Rotate Apache logs on-demand lothario Linux - Software 1 08-11-2004 07:21 PM
Apache access logs lawadm1 Linux - Software 4 08-06-2004 10:20 AM
Apache logs - ???Linux logs??? mylo2003 Linux - General 3 08-07-2003 04:49 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration