Automatic log rotation

It is possible to configure your Unix server to automatically rotate the transfer and/or error logs for you. This explanation assumes a working knowledge of crontab(1), you may wish to look at its man page for more information.

The script ran by the administration server to rotate the log files can be run manually, or rather by crond, to force rotation of the server log files. The script is contained within the Zeus Server directory, called adminroot/docroot/rotate.cgi. Thus if you installed Zeus Server in /usr/local/bin, the full path of the rotate.cgi program would obviously be /usr/local/bin/adminroot/docroot/rotate.cgi and this will be used in the example which follows. This example also assumes the log files are in their default location of /usr/local/zeus/log.

rotate.cgi is a simple program which takes as its only argument the name of the file to rotate. That filename will be rotated in the directory in which it exists, renaming other files as necessary, as described in the explanation of log rotation.

Therefore, to rotate the transfer logs once per week, and the error logs once per month, add the following to the crontab entry of the root user, or the user whom owns the log files if you have configured Zeus Server differently.

# ---
# Zeus Server
# Rotates transfer logs weekly, and error logs monthly
# min  hour  mday  month  wday  command
# 0    0     1     *      *     /usr/local/zeus/adminroot/docroot/rotate.cgi /usr/local/zeus/log/transfer
# 0    0     *     *      6     /usr/local/zeus/adminroot/docroot/rotate.cgi /usr/local/zeus/log/error

Back to log documentation