LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   rotating cruisecontrol.log (https://www.linuxquestions.org/questions/linux-general-1/rotating-cruisecontrol-log-563883/)

tkubaska 06-23-2007 12:32 AM

rotating cruisecontrol.log
 
I'm running a very simple implementation of CruiseControl, doing a build every half hour. My cruisecontrol.log is filling up and I'm looking into some way of rotating that log file. Not sure how to proceed.

I'm reading about logrotate and not sure if that is the appropriate tool to use. Docs refer to logs under /var/log.

I run cruisecontrol as me, not root. My log file (cruisecontrol.log) is in my own build directory, which I put under /opt. It's owned by me, not root. I can write into the directory because I belong to its group. Should I continue to try and figure out how to configure logrotate or look into something else? I'm running Ubuntu Dapper.

What I want to do is copy and compress the current cruisecontrol.log, start up a new one, and then delete compressed versions that are older than a week or so.

Advice is very much appreaciated. Thanks.
-ted

avallach 06-23-2007 01:10 AM

If you put a right path and file name, i think logrotate should do the trick. Logrotates handles root owned files so propably it is runned with root privileges so no matter who owns the file..

tkubaska 06-24-2007 02:17 PM

thanks -- here's what I did
 
Well, here's what I did that works. I chose copytruncate over sending a HUP. I didn't try sending a HUP so not sure if it works with CruiseControl.

Code:

/path/to/cruisecontrol.log {
copytruncate
daily
size 10M
missingok
rotate 5
compress
notifempty
}

I also don't know if this is what people do to solve this problem. I don't have contact with others using CruiseControl and the CruiseCOntrol list has been silnet on this issue.

-ted


All times are GMT -5. The time now is 01:33 PM.