I will give an example of the Bird log rotation script, since by default it was not in Ubuntu 18 and in neighboring versions too.
It is worth considering that the log rotation script will re-read the bird configuration every time, so if you change it, then apply it immediately, otherwise the script will apply it later, which can lead to unforeseen consequences.
After each rotation, two entries will be added to the logs:
<INFO> Reconfiguring
<INFO> Reconfigured
Let’s create a bird log rotation script:
nano /etc/logrotate.d/bird
Here is an example of content:
/var/log/bird/bird.log {
create 0644 bird bird
weekly
rotate 3
missingok
notifempty
sharedscripts
postrotate
/bin/systemctl reload bird
endscript
}
Let’s run the script manually, make sure that the rotation was successful and a new empty bird.log file was created:
logrotate --force /etc/logrotate.d/bird
See also my articles:
Setting up BIRD logs
Configuring logrotate to rotate logs