Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 07-30-2009, 10:46 AM   #1
LQ Newbie
Registered: Jul 2009
Posts: 9

Rep: Reputation: 0
logrotate for messages file

I need to modify my /etc/logrotate.d/syslog file so after evry rotation it will create the new messages file with 604 permissions rw-----r
The problem I have is that I don't know were to put the right line in the file and what is the right syntax to do it only for the messages file ,
see the content of syslog :
/var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron {
/bin/kill -HUP `cat /var/run/ 2> /dev/null` 2> /dev/null || true
/bin/kill -HUP `cat /var/run/ 2> /dev/null` 2> /dev/null || true

you can see that this file works not only on the messages file but also on others.


Last edited by shaife720; 07-30-2009 at 10:47 AM.
Old 07-30-2009, 11:19 AM   #2
LQ Guru
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 555Reputation: 555Reputation: 555Reputation: 555Reputation: 555Reputation: 555
Why not take /var/log/messages out of that function, and give it its own function, where you can put your create option?

Like so:

/var/log/messages {
create 0604 root root
/bin/kill -HUP `cat /var/run/ 2> /dev/null` 2> /dev/null || true
/bin/kill -HUP `cat /var/run/ 2> /dev/null` 2> /dev/null || true
PS - see `man logrotate` for further details and other options.


Last edited by GrapefruiTgirl; 07-30-2009 at 11:23 AM. Reason: Welcome to LQ, by the way :)
Old 08-10-2009, 05:50 AM   #3
LQ Newbie
Registered: Jul 2009
Posts: 9

Original Poster
Rep: Reputation: 0
Thank You sahsa


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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
logrotate creates /var/log/messages with the wrong selinux context on RHEL5 smoyse Red Hat 3 03-30-2009 08:20 PM
Logrotate/ bash script not rotating file noir911 Linux - Server 2 01-15-2009 03:56 PM
Redirecting the kernel messages to file other than /var/log/messages jyotika_b83 Linux - General 3 04-28-2005 06:39 PM
syslog and firestarter - log messages to another file than messages mule Linux - Newbie 0 08-07-2003 03:35 AM
Error in Logrotate.status file tomdlam Linux - General 0 10-17-2002 08:38 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:31 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration