Skip to content

Commit

Permalink
make sure to run logrotate 4 times per day instead of just once during
Browse files Browse the repository at this point in the history
night and also create a maximum of two rotated copies per logfile so that
on a busy system logfiles won't overrun the /var filesystem
(refs #2970)
  • Loading branch information
jens-maus committed Jan 3, 2025
1 parent 270c908 commit 7528340
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion buildroot-external/overlay/base-raspmatic/etc/crontab.root
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
*/11 * * * * [ -c /dev/rtc0 ] && /sbin/hwclock --systohc --utc
1 3,9,15,21 * * * [ ! -e /usr/local/HMLGW ] && /bin/SetInterfaceClock
0 4 * * * /usr/sbin/logrotate /etc/logrotate.conf || logger -p error -t "logrotate" "logrotate aborted with error $?"
0 4,10,16,22 * * * /usr/sbin/logrotate /etc/logrotate.conf || logger -p error -t "logrotate" "logrotate aborted with error $?"
*/1 * * * * /bin/updateDCVars.tcl >/dev/null 2>/dev/null
7 0 * * * /bin/nice /bin/cronBackup.sh >/dev/null 2>/dev/null
0 4 * * 6 [ ! -e /etc/config/NoFSTRIM ] && /bin/nice /sbin/fstrim --listed-in /etc/fstab:/proc/self/mountinfo --verbose --quiet-unsupported | logger -p info -t fstrim
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
1 3,9,15,21 * * * /bin/SetInterfaceClock
0 4 * * * /usr/sbin/logrotate /etc/logrotate.conf || logger -p error -t "logrotate" "logrotate aborted with error $?"
0 4,10,16,22 * * * /usr/sbin/logrotate /etc/logrotate.conf || logger -p error -t "logrotate" "logrotate aborted with error $?"
*/1 * * * * /bin/updateDCVars.tcl >/dev/null 2>/dev/null
7 0 * * * /bin/nice /bin/cronBackup.sh >/dev/null 2>/dev/null
*/10 * * * * [ -d /media/usb0/measurement ] && /bin/nice /usr/bin/rsync -aogX --delete-after --no-whole-file --checksum /tmp/measurement/ /media/usb0/measurement/ >/dev/null 2>/dev/null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
1 3,9,15,21 * * * [ ! -e /usr/local/HMLGW ] && /bin/SetInterfaceClock
0 4 * * * /usr/sbin/logrotate /etc/logrotate.conf || logger -p error -t "logrotate" "logrotate aborted with error $?"
0 4,10,16,22 * * * /usr/sbin/logrotate /etc/logrotate.conf || logger -p error -t "logrotate" "logrotate aborted with error $?"
*/1 * * * * /bin/updateDCVars.tcl >/dev/null 2>/dev/null
7 0 * * * /bin/nice /bin/cronBackup.sh >/dev/null 2>/dev/null
*/10 * * * * [ -d /media/usb0/measurement ] && /bin/nice /usr/bin/rsync -aogX --delete-after --no-whole-file --checksum /tmp/measurement/ /media/usb0/measurement/ >/dev/null 2>/dev/null
Expand Down
2 changes: 1 addition & 1 deletion buildroot-external/overlay/base/etc/crontab.root
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
*/11 * * * * [ -c /dev/rtc0 ] && /sbin/hwclock --systohc --utc
14 4 * * * /bin/SetInterfaceClock
0 4 * * * /usr/sbin/logrotate /etc/logrotate.conf || logger -p error -t "logrotate" "logrotate aborted with error $?"
0 4,10,16,22 * * * /usr/sbin/logrotate /etc/logrotate.conf || logger -p error -t "logrotate" "logrotate aborted with error $?"
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/var/log/*.log /var/log/*/*.log /var/log/messages /var/log/messages.1 {
size 2M
copytruncate
rotate 1
rotate 2
compress
missingok
}

0 comments on commit 7528340

Please sign in to comment.