Skip to content

configure polling intervals

roubles edited this page Jul 23, 2015 · 7 revisions

Building on the examples in basic example, wakeup server before mounting, testing mounts, unmount before mount and status notification commands we will now discuss polling intervals.

macmounter launches one thread per section in every config file. This thread will re-poll every RECHECK_INTERVAL_SECONDS by default. By default this is set to 300 seconds (5 minutes).

However you can configure repoll based on the state of the mount. For instance, if the ping failed, you can repoll every, say, 600 seconds (10 minutes). If the mount failed, you can poll every, say 60 seconds (2 minutes). If the mount is successful you can repoll every 420 seconds (7 minutes).

If not specified, the default for RECHECK_INTERVAL_SECONDS is 300 seconds. The default for RECHECK_INTERVAL_SECONDS_PING_FAILURE, RECHECK_INTERVAL_SECONDS_MOUNT_SUCCESS, RECHECK_INTERVAL_SECONDS_MOUNT_FAILURE is whatever is set for RECHECK_INTERVAL_SECONDS.

[example.com]
MOUNT_TEST_CMD=ls -l /Volumes/example && /sbin/mount | grep -q example
WAKE_CMD=/usr/local/bin/wakeonlan
WAKE_ATTEMPTS=5
PING_CMD=/sbin/ping -q -c3 -o example.com
PRE_MOUNT_CMD=/sbin/umount -f /Volumes/example; /bin/mkdir -p /Volumes/example
MOUNT_CMD=/sbin/mount -t smbfs //roubles@example.com/remotefolder /Volumes/example
MOUNT_SUCCESS_CMD=/bin/echo "" | /usr/bin/mail -s "mounted example.com!" roubles@github.com
MOUNT_FAILURE_CMD=/bin/echo "${REASON}" | /usr/bin/mail -s "unable to mount example.com!" roubles@github.com
LOST_MOUNT_CMD=/bin/echo "" | /usr/bin/mail -s "lost mount for example.com!" roubles@github.com
RECHECK_INTERVAL_SECONDS_PING_FAILURE=600
RECHECK_INTERVAL_SECONDS_MOUNT_FAILURE=60
RECHECK_INTERVAL_SECONDS_MOUNT_SUCCESS=420

Clone this wiki locally