Browse Source

Rotate selfoss logs

My selfoss logs were using 10GB of space because they weren't being rotated properly.
Justin Plock 10 years ago
parent
commit
e11f494183
2 changed files with 11 additions and 0 deletions
  1. 8
    0
      roles/news/files/etc_logrotate_selfoss
  2. 3
    0
      roles/news/tasks/selfoss.yml

+ 8
- 0
roles/news/files/etc_logrotate_selfoss View File

@@ -0,0 +1,8 @@
1
+/var/www/selfoss/data/logs/*.log {
2
+        daily
3
+        missingok
4
+        rotate 5
5
+        compress
6
+        notifempty
7
+        create 0644 www-data www-data
8
+}

+ 3
- 0
roles/news/tasks/selfoss.yml View File

@@ -41,3 +41,6 @@
41 41
 
42 42
 - name: Install selfoss cronjob
43 43
   cron: name="selfoss" user="www-data" minute="*/5" job="curl --silent --show-error -k 'https://{{ selfoss_domain }}/update' > /dev/null"
44
+
45
+- name: Configure selfoss logrotate
46
+  copy: src=etc_logrotate_selfoss dest=/etc/logrotate.d/selfoss owner=root group=root mode=0644

Loading…
Cancel
Save