]> arthur.barton.de Git - netdata.git/commitdiff
Add logrotate configuration
authorMatthew Newton <mcn4@leicester.ac.uk>
Sun, 3 Apr 2016 20:12:54 +0000 (21:12 +0100)
committerMatthew Newton <mcn4@leicester.ac.uk>
Fri, 8 Apr 2016 22:20:26 +0000 (23:20 +0100)
system/Makefile.am
system/netdata.logrotate.in [new file with mode: 0644]

index 49cb5f7bc1b481f30f33c64674a865e554ce5c7f..e20cdd74c7bf90f00e6d79f79c979e8790e68d8a 100644 (file)
@@ -4,6 +4,7 @@
 MAINTAINERCLEANFILES= $(srcdir)/Makefile.in
 CLEANFILES = \
        netdata-openrc \
+       netdata.logrotate \
        netdata.service \
        netdata-init-d \
        $(NULL)
@@ -14,12 +15,14 @@ SUFFIXES = .in
 
 nodist_noinst_DATA = \
        netdata-openrc \
+       netdata.logrotate \
        netdata.service \
        netdata-init-d \
        $(NULL)
 
 dist_noinst_DATA = \
        netdata-openrc.in \
+       netdata.logrotate.in \
        netdata.service.in \
        netdata-init-d.in \
        $(NULL)
diff --git a/system/netdata.logrotate.in b/system/netdata.logrotate.in
new file mode 100644 (file)
index 0000000..763eb09
--- /dev/null
@@ -0,0 +1,15 @@
+@localstatedir_POST@/log/netdata/*.log {
+       daily
+       missingok
+       rotate 14
+       compress
+       delaycompress
+       notifempty
+       sharedscripts
+       postrotate
+               if service netdata status > /dev/null ; then \
+                       service netdata restart > /dev/null; \
+               fi;
+       endscript
+}
+