diff --git a/mailsync b/mailsync new file mode 100755 index 0000000..ccaa2f4 --- /dev/null +++ b/mailsync @@ -0,0 +1,20 @@ +#!/bin/sh + +# Temp disable +#exit 0 + +if pgrep -x mbsync > /dev/null ; then + >&2 echo "Isync is already running, aborting..." + exit 1 +fi + +timeout 10m mbsync -a +if [ "$?" -eq 124 ];then + >&2 echo "Command mbync -a timed out" +elif [ "$?" -eq 0 ];then + >&2 echo "Successful mail synchronisation" +else + >&2 echo "Isync exited with status $?" +fi +fdm fetch +notmuch new