LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Logrotate stops when the file is missing. (https://www.linuxquestions.org/questions/linux-software-2/logrotate-stops-when-the-file-is-missing-4175447980/)

shri_22ram 01-31-2013 07:33 AM

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?

acid_kewpie 01-31-2013 07:39 AM

if you check the standard logrotate docs like "man logrotate.conf" you'll see the missingok option, which is probably what you want here.

shri_22ram 02-04-2013 01:41 AM

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?

shri_22ram 02-13-2013 05:51 AM

Latest revision has a fix
Rev: logroatate-3.7.4-r-12.


All times are GMT -5. The time now is 05:22 PM.