summaryrefslogtreecommitdiffstats
path: root/extras/glusterfs-logrotate
diff options
context:
space:
mode:
Diffstat (limited to 'extras/glusterfs-logrotate')
-rw-r--r--extras/glusterfs-logrotate68
1 files changed, 68 insertions, 0 deletions
diff --git a/extras/glusterfs-logrotate b/extras/glusterfs-logrotate
new file mode 100644
index 00000000000..6ba6ef18e9f
--- /dev/null
+++ b/extras/glusterfs-logrotate
@@ -0,0 +1,68 @@
+# Rotate client logs
+/var/log/glusterfs/*.log {
+ sharedscripts
+ weekly
+ maxsize 10M
+ minsize 100k
+
+# 6 months of logs are good enough
+ rotate 26
+
+ missingok
+ compress
+ delaycompress
+ notifempty
+ postrotate
+ /usr/bin/killall -HUP glusterfs > /dev/null 2>&1 || true
+ /usr/bin/killall -HUP glusterd > /dev/null 2>&1 || true
+ endscript
+}
+
+# Rotate server logs
+/var/log/glusterfs/bricks/*.log {
+ sharedscripts
+ weekly
+ maxsize 10M
+ minsize 100k
+
+# 6 months of logs are good enough
+ rotate 26
+
+ missingok
+ compress
+ delaycompress
+ notifempty
+ postrotate
+ /usr/bin/killall -HUP glusterfsd > /dev/null 2>&1 || true
+ endscript
+}
+
+/var/log/glusterfs/samples/*.samp {
+ daily
+ rotate 3
+ sharedscripts
+ missingok
+ compress
+ delaycompress
+}
+
+# Rotate snapd log
+/var/log/glusterfs/snaps/*/*.log {
+ sharedscripts
+ weekly
+ maxsize 10M
+ minsize 100k
+
+ # 6 months of logs are good enough
+ rotate 26
+
+ missingok
+ compress
+ delaycompress
+ notifempty
+ postrotate
+ for pid in `ps -aef | grep glusterfs | egrep "snapd" | awk '{print $2}'`; do
+ /usr/bin/kill -HUP $pid > /dev/null 2>&1 || true
+ done
+ endscript
+}