Created
August 15, 2019 14:33
-
-
Save adaRn/337838d87cd8f544407d6446cf7daa80 to your computer and use it in GitHub Desktop.
This is logrotate configuration for OpenVPN. It prevents you from huge OpenVPN log files. `copytruncate` option here is very important - OpenVPN doesn't want to close the logfile it's writing to, so this file is automatically truncated after copying its contents.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/var/log/openvpn.log { | |
daily | |
rotate 12 | |
compress | |
copytruncate | |
delaycompress | |
missingok | |
notifempty | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Instead of copytruncate, tell OpenVPN to log to syslog and use syslog's facilities to redirect logging to separate files. Then you won't need to dance around deficiencies of (very basic) internal OpenVPN's logging.
Even better would be to leave openvpn logging to console and tell init daemon to capture it to syslog.
This way you won't miss the scripts output as well.