LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 05-17-2024, 11:25 AM   #1
vinmansbrew
Member
 
Registered: Feb 2016
Posts: 195

Rep: Reputation: Disabled
bi-weekly log rotation


So, I have a request to set up log rotation.
It's a rhel 8.9, using logrotate.

I decided to re-open this, instead of a new question.
I just want to see if my logrotate config is correct.
Quote:
/recv/*-confg {
monthly
rotate 24
maxage 184
olddir /recv/oldlogs
compress
delaycompress
}
I might not need the rotate 24 syntax, but I wanted to make sure nothing under 6 months got deleted.

I ask, as I have tried to run logrotate -d /etc/logrotate.d/ciscobackup
And I get no output into the directory I created /recv/oldlogs. Would that be because I have it set for monthly, and since it hasn't been a month, it isn't rotating anything? That seems to be what the message says. "log does not need rotating (log has been rotated at 2024-5-17 9:0, that is not month ago yet)"

I am just looking for confirmation. If that's the case, I assume if I change it to daily, then it should work, daily.

Last edited by vinmansbrew; 05-22-2024 at 01:55 PM. Reason: question change
 
Old 05-17-2024, 08:38 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,384
Blog Entries: 28

Rep: Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164
Glad you got off the hook!

You might consider marking this thread solved, as you no longer have a question.
 
Old 05-18-2024, 03:39 AM   #3
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,832

Rep: Reputation: 1219Reputation: 1219Reputation: 1219Reputation: 1219Reputation: 1219Reputation: 1219Reputation: 1219Reputation: 1219Reputation: 1219
Two fixed day-of-month in cron would have been
0 23 8,22 * * ...
Not the 30th, think of February!

Interesting fact:
0 23 */14 * * ...
is like
0 23 1,15,29 * * ...
and not "every 2 weeks".
 
  


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
Log parsing but issue with log rotation Rohant Linux - Server 1 05-30-2013 09:09 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 - Server

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