Server log rotation scheduling

Note For another way to schedule server log rotation, see Create a Transfer Log Maintenance application and Create a Log Entry Maintenance application.

Log files are rotated so that you do not lose any information because you have reached a file size limit. The log rotation schedule for log4j files is specified in the log4j configuration files. All other log files are rotated on a regular schedule as directed by a log rotation scheduling tool. You can modify the log rotation schedule by editing the root crontab file. (For details, refer to man 5 crontab.)

On UNIX-based systems, the root crontab file is located in the /var/spool/cron/crontabs/root directory for Oracle Solaris and AIX or the /var/spool/cron/root directory for Linux. These paths are under the system root directory, not <FILEDRIVEHOME>. Use the crontab -e command to edit this file while logged in as root; it opens the file in the vi editor.

On Windows, it is not possible to modify existing cron jobs or to use cron to run any jobs other than the predefined SecureTransport jobs. Use the Task Scheduler or some other method to schedule server log rotation.

Note If SecureTransport is installed to run a non-root user, the crontab file is named after the non-root user.

The schedule fields in this file, and the allowable values for each one, are:

  • Minutes 0-59
  • Hours 0-23
  • Day of Month 1-31
  • Month 1-12 (or name)
  • Day of Week 0-7, where Sunday is 0 or 7 (or name)

So the format looks like the following:

<Minutes> <Hours> <Day of Month> <Month> <Day of Week> <path to rotate script> >> <path to output file> 2>&1

A * character in any field means all legal values. For example, a * in the Day of Week field configures the rotation schedule to run every day of the week. You can also use multiple elements separated by commas in any field, where an element is either a single number (such as 4) or a range of numbers separated by a hyphen (such as 4-8). For more information, run man 5 crontab.

To disable a rotate job, put a # character at the beginning of the line that calls it.

Related topics:

Rotation job examples

The following examples are shown for UNIX-based platforms.

The default rotate job as defined during installation runs every night at 11:59 PM:

59 23 * * * "/opt/Axway/SecureTransport/bin/rotate"

To run the job every Sunday at midnight:

0 0 * * 0 "/opt/Axway/SecureTransport/bin/rotate"

To run the job every eight hours at midnight, 8:00 A.M., and 4:00 P.M. on Monday through Friday:

0 0,8,16 * * 1-5 "/opt/Axway/SecureTransport/bin/rotate"

Related Links