You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
calculate-overlay/profiles/templates/3.3/6_ac_update_sync/revision/02-restore_crontab_if_empty

32 lines
860 B

# Calculate ini(overlay-calculate.revision)<2 run=/bin/bash merge=sys-process/vixie-cron
#-ini(overlay-calculate.revision,2)-#
#?cl_chroot_status==off#
/bin/sed -i '/cl-update/d' /etc/crontab
# restore crontab if it is corrupted
if ! grep -q lastrun/cron.hourly /etc/crontab
then
(cat <<EOF
# for vixie cron
#
# Global variables
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# check scripts in cron.hourly, cron.daily, cron.weekly and cron.monthly
59 * * * * root rm -f /var/spool/cron/lastrun/cron.hourly
9 3 * * * root rm -f /var/spool/cron/lastrun/cron.daily
19 4 * * 6 root rm -f /var/spool/cron/lastrun/cron.weekly
29 5 1 * * root rm -f /var/spool/cron/lastrun/cron.monthly
*/10 * * * * root test -x /usr/sbin/run-crons && /usr/sbin/run-crons
EOF
)>/etc/crontab
fi
#cl_chroot_status#
true