LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 01-28-2008, 03:54 AM   #1
andrew.46
Senior Member
 
Registered: Oct 2007
Distribution: Slackware
Posts: 1,365

Rep: Reputation: 493Reputation: 493Reputation: 493Reputation: 493Reputation: 493
'logrotate' does not rotate news logfile


Hi,

I am logging news (leafnode/fetchnews/texpire) from syslog.conf as follows:

Code:
news.info       -/var/log/news
with no trouble. But I am unable to get logrotate to follow any instructions with this file. In logrotate.conf I have:

Code:
      /var/log/news {
           daily
           rotate 4
           create
           postrotate
                kill -1 `cat /var/run/syslogd.pid`
           endscript
           compress

       }
with absolutely no result. When I test with:

Code:
logrotate -dv /var/log/news
It chokes on the first actual word in the logfile (which is 'January':

Code:
[....]
error: /var/log/news:474 unknown option 'Jan' -- ignoring line
error: /var/log/news:474 unexpected text
error: /var/log/news:475 unknown option 'Jan' -- ignoring line
error: /var/log/news:475 unexpected text
error: /var/log/news:476 unknown option 'Jan' -- ignoring line
error: /var/log/news:476 unexpected text
error: /var/log/news:477 unknown option 'Jan' -- ignoring line
error: /var/log/news:477 unexpected text
error: /var/log/news:478 unknown option 'Jan' -- ignoring line
error: /var/log/news:478 unexpected text

Handling 0 logs
I have obviously missed something very basic and I am keen to know what :-)

Andrew
 
Old 01-28-2008, 02:27 PM   #2
mRgOBLIN
Slackware Contributor
 
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999

Rep: Reputation: 231Reputation: 231Reputation: 231
try
logrotate -dv /etc/logrotate.conf

it should point to your config file not the log file you are trying to rotate.
 
Old 01-28-2008, 03:43 PM   #3
andrew.46
Senior Member
 
Registered: Oct 2007
Distribution: Slackware
Posts: 1,365

Original Poster
Rep: Reputation: 493Reputation: 493Reputation: 493Reputation: 493Reputation: 493
Hi,

Thanks very much for your reply which has completely resolved the issue:

Quote:
Originally Posted by mRgOBLIN View Post
try
logrotate -dv /etc/logrotate.conf

it should point to your config file not the log file you are trying to rotate.
I am now wearing a hat that says: 'Noob of the month'!

Andrew
 
  


Reply



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
Shell scripting: Print output to logfile, error to logfile & screen stefanlasiewski Programming 18 05-22-2008 12:47 PM
LXer: What's your favorite news hub for free software news? LXer Syndicated Linux News 0 07-14-2007 03:16 PM
rotate one screen anton007 Linux - Software 0 06-09-2007 04:25 PM
How to get logrotate to only rotate files 2 days old. yoda_mon Linux - Software 1 05-18-2006 08:55 PM
Log Rotate MaverickApollo Linux - Software 3 01-19-2004 12:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:13 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
Open Source Consulting | Domain Registration