LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 09-05-2018, 02:18 PM   #1
volcblack
Member
 
Registered: Apr 2018
Posts: 36

Rep: Reputation: Disabled
log rotation


Hello Community,

Anyone knows how can I force the log rotations, like the /var/log/messages
example, rotates every 5 month automatically, how can I do this whenever I want without changing the cron conf
 
Old 09-05-2018, 04:20 PM   #2
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
man logrotate
 
Old 09-06-2018, 06:27 PM   #3
X-LFS-2010
Member
 
Registered: Apr 2016
Posts: 510

Rep: Reputation: 58
I stopped using log rotation due to "continual failures" on many fronts

* failure of software to use a standard file (updated software does name changes and makes logs in various places)

* failure of log rotate programs to be configurable and work as expected

the above ammounts to like 100 problems that crop up and end with one or more files that infinitely grow and eventually cause a server to crawl and need reboot

HERE's WHAT I DO INSTEAD. (I run a headless server, no ups backup, and rarely ever hook a keyboard up, it's up months at a time between power losses, and it reboots without intervention)

Every server or software that creates any growing file does so in /var/log (it's a rule I enforce, it's not "automatic").

A simple cron-ized script I have indiscriminately chops all files in and under /var/log to length no matter what: there is never an over-flow.

(the only exception is a db file that records logins - but the simple script has an addition that knows the record length and chops even the db file)

Last edited by X-LFS-2010; 09-06-2018 at 06:29 PM.
 
  


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
[SOLVED] Default rotation of logins log (/var/log/wmtp) gacanepa Linux - Newbie 2 10-01-2013 06:59 PM
[SOLVED] Log rotation of log files in different directories mahi_nix Linux - Server 7 02-19-2013 05:33 AM
Syslog-ng messages.log log rotation Iyyappan Linux - Server 3 09-16-2012 11:10 AM
How to change Debian log rotation of syslog and daemon.log onmountain Linux - Newbie 2 07-31-2008 02:27 AM
Log Rotation for snort log does not seem to be working CentOS4.5 JasonKretzer Linux - Security 3 06-25-2007 12:25 PM

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

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