From f048aec39006fc98ecb7bb64ff88ba23262c11b7 Mon Sep 17 00:00:00 2001 From: Thomas Schoebel-Theuer Date: Thu, 14 Apr 2016 08:14:01 +0200 Subject: [PATCH] userspace: add example cronjob --- userspace/cron.d/mars | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 userspace/cron.d/mars diff --git a/userspace/cron.d/mars b/userspace/cron.d/mars new file mode 100644 index 00000000..406932d8 --- /dev/null +++ b/userspace/cron.d/mars @@ -0,0 +1,19 @@ +# 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 log-delete-all all; sleep 3 ; marsadm log-rotate 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