From 945ab070b72ebd9f5ccfe0052ed138a93b83b297 Mon Sep 17 00:00:00 2001 From: zsdc Date: Mon, 13 Dec 2021 20:05:25 +0200 Subject: logs: T3774: Added new CLI item Added the ability to control the `/var/log/messages` rotation. Renamed the option `maxsize` to `max-size`. --- data/templates/logs/logrotate/vyos-atop.tmpl | 2 +- data/templates/logs/logrotate/vyos-rsyslog.tmpl | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 data/templates/logs/logrotate/vyos-rsyslog.tmpl (limited to 'data/templates') diff --git a/data/templates/logs/logrotate/vyos-atop.tmpl b/data/templates/logs/logrotate/vyos-atop.tmpl index 797bf237f..444d1da36 100644 --- a/data/templates/logs/logrotate/vyos-atop.tmpl +++ b/data/templates/logs/logrotate/vyos-atop.tmpl @@ -2,7 +2,7 @@ daily dateext dateformat _%Y-%m-%d_%H-%M-%S - maxsize {{ maxsize|default('10') }}M + maxsize {{ max_size|default('10') }}M missingok nocompress nocreate diff --git a/data/templates/logs/logrotate/vyos-rsyslog.tmpl b/data/templates/logs/logrotate/vyos-rsyslog.tmpl new file mode 100644 index 000000000..3af1bfd8e --- /dev/null +++ b/data/templates/logs/logrotate/vyos-rsyslog.tmpl @@ -0,0 +1,13 @@ +/var/log/messages { + create + missingok + nomail + notifempty + rotate {{ rotate|default('10') }} + size {{ max_size|default('1') }}M + postrotate + # restart rsyslog service + systemctl restart rsyslog.service + endscript +} + -- cgit v1.2.3