我想要轮转我的OpenVPN日志。我该如何实现这个目标?
# Create a template for the vpn log location
$template OpenVPN,"/var/log/openvpn/ovpn.log"
# Save log events where the programname starts with ovpn like ovpn-server to the
# location mentioned in the template
:programname, startswith, "ovpn-" -?OpenVPN
# Stop processing ovpn-* log events
:programname, startswith, "ovpn-" ~
grep ^log /etc/openvpn/server.conf
/var/log/openvpn/*.log {
weekly
size 100M
rotate 4
compress
delaycompress
missingok
notifempty
create 640 syslog adm
}
if $programname startswith 'ovpn-' then /var/log/openvpn/ovpn.log
& ~
如果$programname以'openvpn'开头,则/var/log/openvpn/ovpn.log
& ~
- xkill
copytruncate
。 - mivk