LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 04-08-2009, 03:18 PM   #1
SPEEDEX
LQ Newbie
 
Registered: Apr 2007
Posts: 22

Rep: Reputation: 0
Arrow logrotate manually


Hi,
I have a CentOS 5 , I wanted to rotate the current system log files manually and download them for trouble shooting , so I went to /etc/logrotate.d and executed this command "logrotate syslog" , but when I went to /var/log directory , there was no messages.1 file ! the messages file was new , but seems messages.1 file is deleted ! is it normal ?
what is the proper way to rotate logs ?
Regards
 
Old 04-08-2009, 03:45 PM   #2
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
if you want to force a rotatation which is uncalled for in the config files, you need to give it a "-f":
Code:
logrotate -f /path/to/some/logrotate.conf
 
Old 04-08-2009, 03:47 PM   #3
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora, Lubuntu, FreeBSD
Posts: 3,930
Blog Entries: 5

Rep: Reputation: Disabled
Barging in for a comment: I could have used that -- last week.
 
Old 04-08-2009, 03:56 PM   #4
SPEEDEX
LQ Newbie
 
Registered: Apr 2007
Posts: 22

Original Poster
Rep: Reputation: 0
Thank you , but the problem is that rotation has been done , but the file was missing ! there was messages and messages.2 file , but there was no messages.1 !
 
Old 04-08-2009, 04:20 PM   #5
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
@speedex: could it be because you don't have a create option in your config file?
@anomie: it'll be good for next time, then.
 
Old 04-08-2009, 04:23 PM   #6
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 163Reputation: 163
Quote:
Originally Posted by SPEEDEX View Post
Hi,
I have a CentOS 5 , I wanted to rotate the current system log files manually and download them for trouble shooting , so I went to /etc/logrotate.d and executed this command "logrotate syslog" , but when I went to /var/log directory , there was no messages.1 file ! the messages file was new , but seems messages.1 file is deleted ! is it normal ?
what is the proper way to rotate logs ?
Regards
I've observed this issue with logrotate in the past, I'm not sure there is a solution. Anytime I use -f /path/to/conf/filename.conf it ends up wiping a log. I filed a bug report on the behavior at one point.
 
Old 07-19-2010, 01:38 AM   #7
skles
LQ Newbie
 
Registered: Jun 2010
Posts: 1

Rep: Reputation: 0
If you use

logrotate -f /etc/logrotate.conf

then you will find messages.1

I don't know why.
 
Old 07-19-2010, 12:17 PM   #8
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 197Reputation: 197
Quote:
Originally Posted by rweaver View Post
I've observed this issue with logrotate in the past, I'm not sure there is a solution. Anytime I use -f /path/to/conf/filename.conf it ends up wiping a log. I filed a bug report on the behavior at one point.
Could it be that it's wiping one because you have it set to only keep so many copies? default is usually 4 at most. Change your conf to keep longer retention on rotated logs.
 
  


Reply

Tags
centos5, logrotate, manual


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
I need a little help with logrotate Udi Linux - Newbie 1 02-02-2009 11:01 AM
How to manually add SATA driver manually when kernel boot? aixilin Linux - Kernel 6 08-15-2008 10:36 AM
Why we use logrotate ? shipon_97 Linux - Newbie 4 01-09-2008 09:15 AM
Logrotate Help! MaverickApollo Linux - Software 3 02-19-2004 12:09 PM
logrotate Rig24 Linux - Newbie 2 07-11-2003 05:08 AM


All times are GMT -5. The time now is 08:15 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