Skip to content

OGo Docs

Sections
Personal tools
You are here: Home » Members » olivier's Home » Rotation of ogo.log

Rotation of ogo.log

Document Actions
This is a brief how-to on the rotation of ogo.log in a Mandrake system

Logrotation of ogo.log


This simple how-to shows the way to rotate ogo.log in a Mandrake 9.x system, in order to avoid a very large log file


Pre requisite

Package logrotate must be installed.

Preamble

Logrorate configuration is located in /etc. One file and one directory are important.


  1. /etc/logrotate.conf

  2. /etc/logrotate.d


In Mandrake Linux, there is no need to modify /etc/logrotate.conf. The file has a include clause that will execute log rotation of all files defined in the /etc/logrotate.d directory. Therefore it will be necessary to add the ogo.log stuffs in /etc/logrotate.d


Create a file named ogo with the following contents:


[root@opengroupware log]# cat /etc/logrotate.d/ogo
/var/log/ogo.log {
daily   
notifempty
missingok
prerotate
       /sbin/service opengroupware stop
    endscript
postrotate
       /sbin/service opengroupware start
    endscript
}


Voilà. That's all needed.

Obs. Thank's Helge for the pre-rotate stuff.


Operation:

Logorotate binary will be activated by cron, on a daily base. If your Mandrake system is running fine, this will be activated automatically. If you prefer to rotate log on a weekly base, change "daily" to "weekly" above.



Created by olivier
Last modified 2004-07-30 05:40 PM
 

Powered by Plone

This site conforms to the following standards: