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 04-12-2016, 12:11 PM   #16
blktux
LQ Newbie
 
Registered: Apr 2016
Posts: 11

Original Poster
Rep: Reputation: Disabled

Solution:
I modified the /etc/logrotate.d/rabbitmq-server by adding the following options:
- copytruncate

and subtracting the following options:
- size 100M
- notifempty

I removed the size limit because it was not working as I wanted it to and I removed the 'notifempty' configuration because I want the log file rotated even if it's empty. NOTE: 'ifempty' is the default.

I added the 'copytruncate' configuration in order to copy the active log file to a backup and truncate the active log file.

Lastly, I removed the 'force' configuration from my previous post. From what I gather the 'force' option or '-f' is only used when you execute logrotate via the command line and is not used when placed in the actual config file.

Below is the solution to my log rotation needs:
/var/log/rabbitmq/*.log
daily
missingok
dateext
rotate 5
compress
copytruncate
sharedscripts
postrotate
/sbin/service rabbitmq-server rotate-logs > /dev/null
endscript
}

Thanks all for your help!
 
  


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
logrotate - issue command even if no log rotated tighelorr Linux - General 5 10-19-2012 06:34 AM
[SOLVED] logrotate or logrotate.conf; problems with sftp slufoot80 Linux - Server 1 11-05-2011 08:50 AM
RHEL5 syslog facility Local6 Logrotate configuration Issue kamalkgarg Linux - General 8 01-10-2011 05:08 AM
Strange logrotate issue. dxangel Linux - Server 2 08-23-2010 09:12 AM
Logrotate issue stefaandk Fedora 1 01-09-2007 04:17 AM

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

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