summaryrefslogtreecommitdiff
path: root/data/templates/logs
diff options
context:
space:
mode:
authorzsdc <taras@vyos.io>2021-12-07 22:41:27 +0200
committerzsdc <taras@vyos.io>2021-12-07 22:44:34 +0200
commitac73200e4f0cf4020dfcd0a11e6004bca479253f (patch)
treec5478ea432686c46d2a17913828efd573185faa7 /data/templates/logs
parent7ac6b589e3827ea6ff8e796bb6617c021cf26bca (diff)
downloadvyos-1x-ac73200e4f0cf4020dfcd0a11e6004bca479253f.tar.gz
vyos-1x-ac73200e4f0cf4020dfcd0a11e6004bca479253f.zip
logs: T3774: Added CLI options to control atop logs rotation
Added CLI options to generate logrotate configuration file for atop logs
Diffstat (limited to 'data/templates/logs')
-rw-r--r--data/templates/logs/logrotate/vyos-atop.tmpl20
1 files changed, 20 insertions, 0 deletions
diff --git a/data/templates/logs/logrotate/vyos-atop.tmpl b/data/templates/logs/logrotate/vyos-atop.tmpl
new file mode 100644
index 000000000..797bf237f
--- /dev/null
+++ b/data/templates/logs/logrotate/vyos-atop.tmpl
@@ -0,0 +1,20 @@
+/var/log/atop/atop.log {
+ daily
+ dateext
+ dateformat _%Y-%m-%d_%H-%M-%S
+ maxsize {{ maxsize|default('10') }}M
+ missingok
+ nocompress
+ nocreate
+ nomail
+ rotate {{ rotate|default('10') }}
+ prerotate
+ # stop the service
+ systemctl stop atop.service
+ endscript
+ postrotate
+ # start atop service again
+ systemctl start atop.service
+ endscript
+}
+