Setting up NetWorker log file rotation size limits

At times it is necessary to limit the size of the NetWorker logs to prevent the daemon and rap log files from growing too large. To configure the size of certain log files created by NetWorker (notably the daemon.log and rap.log) as well as the number of logs used in the log rotation.

Controlling NetWorker Log file size

To control the size of the logs us the environment variable:

NSR_MAXLOGSIZE=n

Where: n is the target size of the file in bytes (default value is 1048576 bytes (ie: 1 MB))

For example:

Setting NSR_MAXLOGSIZE=52428800, would set the log file size to 50MB

Number of Log files in rotation

To set the number of logs used in the rotation (ie: the maximum number of log files), set the environment variable:

NSR_MAXLOGVERS=n

Where: n is the number of log files to be saved (default value is 4, maximum, maximum number of logs is 999)

For example:

Setting NSR_MAXLOGVERS=5, would set 5 log files in rotation (daemon.raw daemon.001 daemon.002 daemon.003 daemon.004)

Setting environment variables under Windows

Under Windows, the above values can be set under "System variables"

Windows > My Computer > (right click for Properties) > Advanced > Environmental Variables > System variables > New

Windows Environment variables

Setting NetWorker variables under Solaris/Linux

Under Solaris/Linux, edit the networker startup script /etc/init.d/networker and add the environment variables there.

NOTES:

  • The value set for NSR_MAXLOGSIZE will only take effect after restarting NetWorker server. The daemon.log file size is only checked when NetWorker is started.
  • Therefore the maximum log file size should only be considered as a guideline and not as a hard rule. The daemon.log will exceed this limit if NetWorker is not restarted for an extended period of time.
  • The rap.log file is checked at various intervals but with no set schedule. It too can exceed the maximum log file size but in general not by more than a few Kbytes.
  • If NSR_MAXLOGVERS is set higher than 999, then no log rotation will take place, even if the actual number of log files is less than 999. Some log files, notably the messages file, are not automatically rotated.