LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-31-2013, 07:33 AM   #1
shri_22ram
LQ Newbie
 
Registered: Jan 2013
Posts: 11

Rep: Reputation: Disabled
Logrotate stops when the file is missing.


I am forcing logrotate utility to execute. But it stops immediately after a file was missing. Actually logrotate should run with warning. Any idea on this?
 
Old 01-31-2013, 07:39 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
if you check the standard logrotate docs like "man logrotate.conf" you'll see the missingok option, which is probably what you want here.
 
Old 02-04-2013, 01:41 AM   #3
shri_22ram
LQ Newbie
 
Registered: Jan 2013
Posts: 11

Original Poster
Rep: Reputation: Disabled
Thanks for the reply Chris...

Below are the different configurations of the same file. Actually test folder is not present. My intention is to logrotate will rotate even the file/not directory is not present.

/opt/sample/test/var/log/std_out.log /opt/sample/test/var/log/std_err.log{
rotate 5
daily
missingok
notifempty
compress
sharedscripts
postrotate
/bin/kill -HUP `cat /opt/UMC/sae/var/run/daemon.pid 2> /dev/null` 2> /dev/null || true
endscript

}

After rotating forcibly logrotate skips the config and continues execution.
But logrotate stops when i will give wild characters in the place of std_out
/opt/sample/test/var/log/std_*.log{
rotate 5
daily
missingok
notifempty
compress
sharedscripts
postrotate
/bin/kill -HUP `cat /opt/UMC/sae/var/run/daemon.pid 2> /dev/null` 2> /dev/null || true
endscript

}

ie) if will mention all the files individually logrotate continues execution but it stops when i use std_*.log in the place of stdout.
Can you please help in this?
 
Old 02-13-2013, 05:51 AM   #4
shri_22ram
LQ Newbie
 
Registered: Jan 2013
Posts: 11

Original Poster
Rep: Reputation: Disabled
Latest revision has a fix
Rev: logroatate-3.7.4-r-12.
 
  


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] logrotate or logrotate.conf; problems with sftp slufoot80 Linux - Server 1 11-05-2011 07:50 AM
[SOLVED] logrotate not create empty file malikperera Linux - Server 1 03-24-2010 06:30 PM
Changes to my logrotate.conf file do I need to reboot? mccartjd Linux - Newbie 5 01-08-2010 01:28 AM
logrotate for messages file shaife720 Linux - General 2 08-10-2009 05:50 AM
after setting up logrotate for apache, logging stops apachenew Linux - General 2 11-26-2007 10:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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