mars/userspace/cron.d/mars
2017-09-27 07:11:46 +02:00

21 lines
1.1 KiB
Plaintext

# Regular cron jobs for MARS
#
PATH=/usr/local/bin:/usr/lib/mars:/sbin:/bin:/usr/sbin:/usr/bin
# MARS transaction logfile rotation + deletion every x minutes
*/10 * * * * root if [ -L /mars/uuid ] ; then marsadm cron ; fi > /dev/null 2>&1
*/5,15,25,35,45,55 * * * * root if [ -L /mars/uuid ] ; then marsadm log-delete-all all ; fi > /dev/null 2>&1
# When a different mars kernel module is installed than actually loaded
# into the kernel, _try_ to reload it.
# This will silently fail when at least one resource is in primary mode.
# However, this will be automatically retried until it succeeds some day.
# This leads to a very short interruption of the replication, similar
# to a small network outage. It does not change any state: it relies on
# the fundamental property of MARS to restore _any_ previous operation mode
# after a crash, just by a simple modprobe.
@hourly root if [ -L /mars/uuid -a -e /sys/module/mars/version ] && [ "$(modinfo mars | grep "^version:" | sed 's/^version:\s*//')" != "$(cat /sys/module/mars/version)" ]; then rmmod mars && modprobe mars ; fi > /dev/null 2>&1