Add mail synchronisation script, sequencial version

This commit is contained in:
lhark 2019-02-15 18:34:26 -05:00
parent 211d6d58a6
commit 3ad6614284

20
mailsync Executable file
View file

@ -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