LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   I need a little help with logrotate (https://www.linuxquestions.org/questions/linux-newbie-8/i-need-a-little-help-with-logrotate-701661/)

Udi 02-02-2009 10:15 AM

I need a little help with logrotate
 
Hi :)

I am trying a very basic usage of logrotate:
1) I create a basic configuration file called /etc/qalogrotate
2) I call logrotate on the command line with "/etc/qalogrotate" as the parameter

=> The log file moves to the log directory but the original file is deleted. This is a problem because the daemon which is logging to the file won't handle the disappearance of the log file, and no further logging will be made.

The way I expect it to work is, that the daemon won't even notice that the file was rotated, and will continue to log to the file as usual (only that now the file should be blank). That's the whole purpose of existence of logrotate, no? Why does it delete the original log file and ruin future logging? Any solution/workaround will be appreciated.

b.t.w - this is the /etc/qalogrotate file I made:
/var/log/mylog/daemon.log {
missingok
olddir qalogrotate
nocreate
nocompress
}

Thanks in advance.
Udi.

openSauce 02-02-2009 11:01 AM

If you look at the man page for logrotate, you'll see the nocreate option tells it not to create the new log file. Try taking that out of your config file.


All times are GMT -5. The time now is 06:52 PM.