The examples in this section show how to configure log rotation according to the time since the last rotation, irrespective of log size.
This configuration rotates the log at 3:00 today and then every 8 hours, irrespective of the size of the log file.
$ dpconf set-access-log-prop -h host1 -p 1389 log-rotation-frequency:8h \ log-rotation-policy:periodic log-rotation-start-time:0300 |
This configuration rotates the log at 3:00, 13:00 and 23:00 every day, irrespective of the size of the log file. Because the log-rotation-start-time parameter takes precedence over the log-rotation-frequency parameter, the log is rotated at 23:00 and then 4 hours later. The log is not rotated at 23:00 and then 10 hours later.
$ dpconf set-access-log-prop -h host1 -p 1389 log-rotation-frequency:10h \ log-rotation-policy:periodic log-rotation-start-time:0300 |
This configuration rotates the log at noon on Monday, and then at the same time every week, irrespective of the size of the log file.
$ dpconf set-access-log-prop -h host1 -p 1389 log-rotation-frequency:1w \ log-rotation-policy:periodic log-rotation-start-day:2 log-rotation-start-time:1200 |
This configuration rotates the log at noon on Monday, and then every 3 days, irrespective of the size of the log file.
$ dpconf set-access-log-prop -h host1 -p 1389 log-rotation-frequency:3d \ log-rotation-policy:periodic log-rotation-start-day:2 log-rotation-start-time:1200 |
The log is rotated on the following days: Monday, Thursday, Sunday, Wednesday, and so on. Notice that the log-rotation-start-day parameter applies to the first week only. The log is not rotated on the Monday of the second week.
This configuration rotates the log at noon on the 22^{nd} day of the month, and then at the same time every month, irrespective of log size.
$ dpconf set-access-log-prop -h host1 -p 1389 log-rotation-frequency:1m \ log-rotation-policy:periodic log-rotation-start-day:22 \ log-rotation-start-time:1200 |
If the log-rotation-start-day is set to 31 and the month has only 30 days, the log is rotated on the first day of the following month. If the log-rotation-start-day is set to 31 and the month has only 28 days (February), the log is rotated on the 3^{rd}.