Just noticed that there are huge trac.logs. The cmucl trac log is 225 MB. The oct and f2cl logs are huge too.
Is there any script available to rotate the logs?
Ray
Ray writes:
Just noticed that there are huge trac.logs. The cmucl trac log is 225 MB. The oct and f2cl logs are huge too.
Is there any script available to rotate the logs?
It should be relatively ueasy to convince logrotate to include those in the normal log rotation.
I don't know the path to the trac logs, but that aside, dropping a file with contents something like this into /etc/logrotate.d/ should do the trick:
----->8 Example trac.log rotate specification 8<------ /path/to/trac.log { weekly missingok rotate 5 compress delaycompress notifempty create <mode> <owner> <group> } --------->8 END 8<---------
There's a whole slew of tunables in there. Don't know if daily or monthly would be the right rotation cycle. Don't know how much historical log to save. I do think both "compress" (compress historical logs) and "delaycompress" (don't compress the first few rotated logs) make sense, but...
If the ownership is identical, the path specification should take glob wildcards, so /path/to/projects/*/trac.log MAY work. But I suspect they're differing in at least group, so one per trac log is probably right.
//Ingvar
On 12/15/11 11:01 PM, Ingvar wrote:
Ray writes:
Just noticed that there are huge trac.logs. The cmucl trac log is 225 MB. The oct and f2cl logs are huge too.
Is there any script available to rotate the logs?
It should be relatively ueasy to convince logrotate to include those in the normal log rotation.
I don't know the path to the trac logs, but that aside, dropping a file with contents something like this into /etc/logrotate.d/ should do the trick:
I think all trac logs are in /project/<proj>/trac/log/trac.log.
I guess it would help a lot if I didn't have log_level = DEBUG, which happens to be the value in the sample trac.ini.
----->8 Example trac.log rotate specification 8<------ /path/to/trac.log { weekly missingok rotate 5 compress delaycompress notifempty create <mode> <owner> <group> } --------->8 END 8<---------
There's a whole slew of tunables in there. Don't know if daily or monthly would be the right rotation cycle. Don't know how much historical log to save. I do think both "compress" (compress historical logs) and "delaycompress" (don't compress the first few rotated logs) make sense, but...
I think weekly is probably as often as needed, but I'm guessing. I don't know what the options mean, but I think an uncompressed current log with all historical logs compressed is good. I don't have a good feel for how many logs to keep, but it seems 5 or so is decent.
Ray