Add mail synchronisation script, sequencial version
This commit is contained in:
parent
211d6d58a6
commit
3ad6614284
1 changed files with 20 additions and 0 deletions
20
mailsync
Executable file
20
mailsync
Executable 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
|
Loading…
Reference in a new issue