Run logrotate at boot

This commit is contained in:
David Carley
2021-03-09 23:48:03 -08:00
parent 5544e79913
commit 937f30d844
3 changed files with 12 additions and 0 deletions

1
scripts/cron_d_reboot Normal file
View File

@@ -0,0 +1 @@
@reboot root run-parts /etc/cron.reboot

View File

@@ -0,0 +1,4 @@
#!/bin/sh
test -x /usr/sbin/logrotate || exit 0
/usr/sbin/logrotate /etc/logrotate.conf

View File

@@ -146,6 +146,13 @@ fi
cp ./scripts/bbctrl-logrotate /etc/logrotate.d/bbctrl cp ./scripts/bbctrl-logrotate /etc/logrotate.d/bbctrl
chown root:root /etc/logrotate.d/bbctrl chown root:root /etc/logrotate.d/bbctrl
# Ensure logrotate runs on every boot (for systems with no network, thus bad clock)
if [ ! -e /etc/cron.d/reboot ]; then
cp ./scripts/cron_d_reboot /etc/cron.d/reboot
mkdir -p /etc/cron.reboot
cp ./scripts/cron_reboot_logrotate /etc/cron.reboot/logrotate
fi
########################################## ##########################################
# Begin one-time cleanup tasks for 1.0.7 # Begin one-time cleanup tasks for 1.0.7
########################################## ##########################################