LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-18-2012, 09:29 AM   #1
kedarp
Member
 
Registered: Jul 2012
Distribution: Ubuntu
Posts: 197
Blog Entries: 3

Rep: Reputation: 23
what are rotated logs


I have been using linux for the lat 2 years.
But I came across "Rotated logs" term for the first time. What are they and what is their purpose?
 
Old 08-18-2012, 10:01 AM   #2
gregAstley
LQ Newbie
 
Registered: Aug 2012
Distribution: ubuntu 11.10
Posts: 27

Rep: Reputation: 4
Quote:
Originally Posted by kedarp View Post
I have been using linux for the lat 2 years.
But I came across "Rotated logs" term for the first time. What are they and what is their purpose?
Hi, I was intrigued enough to have a look at this myself (see perhaps http://www-uxsup.csx.cam.ac.uk/~jw35...html/x1670.htm)

An explanation in my own words wouldn't be better than you'll find here but essentially instead of putting all your logging info into one big old log file you can have some ordered set of log files {file_1, ..., file_n} where the newest logs are sent to file_n (and file_{n+1} is created (probably automatically) at some point in the future) and the oldest logs are in file_1 (which will be deleted when file_{n+1} is created)

Helps make the logs you want easier to find and get rid of stuff you don't care about without messing with the file containing logs you want to keep

Last edited by gregAstley; 08-18-2012 at 10:19 AM.
 
Old 08-19-2012, 07:17 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,396

Rep: Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395
Actually, the lowest numbered log is the most recent; numbers go up as logs are aged+rotated.
In fact, the current log being written to is the un-numbered one eg
Code:
ls -lt /var/log/mess*
-rw------- 1 root root 1496907 Aug 20 10:14 messages
-rw------- 1 root root 8333239 Aug 19 04:03 messages.1
-rw------- 1 root root 8339166 Aug 12 04:04 messages.2
-rw------- 1 root root 8348313 Aug  5 04:03 messages.3
-rw------- 1 root root 8344887 Jul 29 04:04 messages.4
Note that this is the default scheme. The re-naming scheme can be specified to be other things eg use the date in format YYYYMMDD, which will sort easily/naturally.
 
1 members found this post helpful.
Old 08-20-2012, 01:37 PM   #4
gregAstley
LQ Newbie
 
Registered: Aug 2012
Distribution: ubuntu 11.10
Posts: 27

Rep: Reputation: 4
Quote:
Originally Posted by chrism01 View Post
Actually, the lowest numbered log is the most recent; numbers go up as logs are aged+rotated.
In fact, the current log being written to is the un-numbered one eg
Code:
ls -lt /var/log/mess*
-rw------- 1 root root 1496907 Aug 20 10:14 messages
-rw------- 1 root root 8333239 Aug 19 04:03 messages.1
-rw------- 1 root root 8339166 Aug 12 04:04 messages.2
-rw------- 1 root root 8348313 Aug  5 04:03 messages.3
-rw------- 1 root root 8344887 Jul 29 04:04 messages.4
Note that this is the default scheme. The re-naming scheme can be specified to be other things eg use the date in format YYYYMMDD, which will sort easily/naturally.
Fair enough, thanks for the correction. That said, as much as I made a poor job of it I was more interested in the fact that the set of logs are ordered (in some way); to me the elements in some set of files {file_1, ..., file_n} are labeled for ease of notation as opposed to being suggestive of a naming scheme.
 
  


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
Easy logrotate question - remove rotated logs after 7 days SmurfGGM Linux - Newbie 1 08-17-2011 06:58 PM
log files not being rotated sang_froid Linux - Server 2 12-11-2009 09:11 AM
Logs are not rotated BroX Slackware 11 06-03-2009 06:49 PM
How Do zmd-messages Logs Get Rotated? ThisGuyIKnow SUSE / openSUSE 2 11-22-2006 11:49 AM
Rotated monitor(s) with Xorg 6.8.1 dnar Linux - Hardware 0 01-09-2005 07:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:20 PM.

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