The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
passing values into logrotate?? imbiea Shell Programming and Scripting 1 06-09-2008 04:03 PM
Disabling logrotate primal UNIX for Dummies Questions & Answers 2 04-14-2008 01:19 PM
how to set size in logrotate.conf icehero UNIX for Dummies Questions & Answers 0 02-24-2008 04:41 AM
logrotate.conf fredao UNIX for Advanced & Expert Users 10 12-19-2006 09:57 AM
Spot karine UNIX for Advanced & Expert Users 1 02-08-2005 05:18 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 01-09-2008
anderow anderow is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 12
Logrotate problems - Can anyone spot the problem please?!

ok guys.
Im very puzzled with this and though Ive been adminstering my own Centos servers for a couple of years now I go a bit rusty as I dont have play with them daily (and theres lots to learn in 'nix)

Im having a problem with my Logrotate.
Basically, I have a Centos server using the latest Centos version and all updated software. It is a webserver and serves 10 websites that are my living.
Linux server@******.net 2.6.9-42.0.10.plus.c4smp #1 SMP Tue Feb 27 17:29:28 EST 2007 i686 i686 i386 GNU/Linux


It was working ok with regards to rotating main log files and renaming them but I added a new file in logrotate.d and since then it has not been playing ball! (even when I removed the file I added) The file I added was called 'virtual' and contained the following becuase the logs on my virtual hosts were getting too bad and I really want them to rotate as manual is a pain.

Quote:
/var/log/httpd/*/.accesslog /var/log/httpd/*/.errorlog /var/log/httpd/*/.sslerrorlog /var/log/httpd/*/.sslaccesslog {
daily
missingok
rotate 365
compress
delaycompress
notifempty
sharedscripts
postrotate

/bin/kill -HUP `cat /var/run/httpd.pid 2>/dev/null` 2> /dev/null || true
endscript
}
Heres my httpd logrotate.d file (original one)

Quote:
var/log/httpd/*.log {
daily
rotate 7
compress
missingok
notifempty
sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/httpd.pid 2>/dev/null` 2> /dev/null || true
endscript
}


ok. So I did this and went to force rotation so that my log files would be brought back to decent sizes..
and I get the following error messages below?

Quote:
[root@server ~]# logrotate -f /etc/logrotate.conf
error: httpd:1 unknown option 'var' -- ignoring line
error: httpd:1 unexpected text
error: httpd:2 unexpected text
error: httpd:3 unexpected text
error: httpd:4 unexpected text
error: httpd:5 unexpected text
error: httpd:6 unexpected text
error: httpd:7 unexpected text
error: httpd: prerotate or postrotate without endscript
This is my logrotate.conf and as you can see its pretty bog standard

Could anyone please tell me what is the problem here. it would be most appreciated thanks

Quote:
# see "man logrotate" for details
# rotate log files weekly
weekly

# keep 4 weeks worth of backlogs
rotate 4

# create new (empty) log files after rotating old ones
create

# uncomment this if you want your log files compressed
#compress

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

# no packages own wtmp -- we'll rotate them here
/var/log/wtmp {
monthly
create 0664 root utmp
rotate 1
}

# system-specific logs may be also be configured here.

#max log file size
size=30m
 

Bookmarks

Tags
linux

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:33 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0