Skip to content

Commit

Permalink
Merge pull request #31 from TheTorProject/fix/log-rotation
Browse files Browse the repository at this point in the history
Hotfix: Cleanup ooniprobe logrotated files
  • Loading branch information
anadahz committed May 23, 2016
2 parents 14583ab + 9e5ee29 commit 08b9f9f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
7 changes: 7 additions & 0 deletions lepidopter-fh/etc/cron.daily/remove_old_logs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
# This cronjob has been created to overcome a limitation of ooniprobe log
# rotations. It deletes files modified by the pattern 'ooniprobe.log.*_*' the
# last 6 days for the ${OONI_LOGS} directory
source /etc/ooniprobe/ooniconfig.sh

find ${OONI_LOGS} -name "ooniprobe.log.*_*" -mtime +6 -type f -delete
13 changes: 1 addition & 12 deletions lepidopter-fh/etc/logrotate.d/ooniprobe
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,11 @@
notifempty
}

/var/log/ooni/oonireport.log {
/var/log/ooni/oonireport.log.* {
missingok
rotate 1
compress
delaycompress
copytruncate
maxsize 1M
notifempty
}

/var/log/ooni/ooniprobe.log {
daily
missingok
rotate 7
compress
delaycompress
copytruncate
maxsize 100M
}
5 changes: 3 additions & 2 deletions lepidopter-fh/etc/ooniprobe/ooniconfig.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#!/bin/bash
OONI_LOGS="/var/log/ooni"
OONI_CONFIG="/etc/ooniprobe/ooniprobe.conf"
OONI_HOME="/opt/ooni"
OONI_REPORTS="/opt/ooni/reports"
OONI_DECK_CONFIG="/etc/ooniprobe/oonideckconfig"
OONI_CRONJOBS_LOG="/var/log/ooni/cronjobs.log"
OONIREPORT_LOG="/var/log/ooni/oonireport.log"
OONI_CRONJOBS_LOG="${OONI_LOGS}/cronjobs.log"
OONIREPORT_LOG="${OONI_LOGS}/oonireport.log"
OONIREPORT_CONFIG="/etc/ooniprobe/oonireport.conf"

datestamp=$(date -u +"%d-%m-%y %R")
Expand Down

0 comments on commit 08b9f9f

Please sign in to comment.