[pmg-devel] applied: [PATCH pmg-api] Add logrotate config for pmgproxy.log

Thomas Lamprecht t.lamprecht at proxmox.com
Fri Apr 24 13:45:22 CEST 2020


On 4/24/20 12:06 PM, Stoiko Ivanov wrote:
> to keep the log from growing without end. Rotate monthly and keep 12 logs,
> since the logs should not be too large (e.g. a productive instance, with
> ~20 users using the quarantine and some configuration changes amounts to
> 108M over 2.5 years)
> 
> the logrotate snippet is placed in /etc/logrotate.d/pmg-api by
> dh_installlogrotate(1).
> 
> Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
> ---
> TIL: monthly rotation in logrotate (sensibly) is based on the current number
> of the month != last rotation number of the month
> 
>  debian/pmg-api.logrotate | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
>  create mode 100644 debian/pmg-api.logrotate
> 
> diff --git a/debian/pmg-api.logrotate b/debian/pmg-api.logrotate
> new file mode 100644
> index 0000000..b11e1c0
> --- /dev/null
> +++ b/debian/pmg-api.logrotate
> @@ -0,0 +1,13 @@
> +/var/log/pmgproxy/pmgproxy.log {
> +	rotate 12
> +	monthly
> +	missingok
> +	compress
> +	delaycompress
> +	notifempty
> +	create 640 www-data www-data
> +	sharedscripts
> +	postrotate
> +		/bin/systemctl try-reload-or-restart pmgproxy.service
> +	endscript
> +}
> 

applied, thanks!



More information about the pmg-devel mailing list