LinuxQuestions.org
Register a domain and help support LQ
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, 08: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, 08:39 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,415

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
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, 02: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, 06: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


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


All times are GMT -5. The time now is 06:40 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration