Run logrotate at boot
This commit is contained in:
1
scripts/cron_d_reboot
Normal file
1
scripts/cron_d_reboot
Normal file
@@ -0,0 +1 @@
|
||||
@reboot root run-parts /etc/cron.reboot
|
||||
4
scripts/cron_reboot_logrotate
Normal file
4
scripts/cron_reboot_logrotate
Normal file
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
test -x /usr/sbin/logrotate || exit 0
|
||||
/usr/sbin/logrotate /etc/logrotate.conf
|
||||
@@ -146,6 +146,13 @@ fi
|
||||
cp ./scripts/bbctrl-logrotate /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
|
||||
##########################################
|
||||
|
||||
Reference in New Issue
Block a user