From: martin f. krafft Date: Tue, 2 Feb 2010 02:23:02 +0000 (+1300) Subject: factor out offlineimap to script and call notmuch X-Git-Url: https://git.madduck.net/etc/offlineimap.git/commitdiff_plain/7ab076e9a34703804e9559bacb050342f3b65f6f factor out offlineimap to script and call notmuch Signed-off-by: martin f. krafft --- diff --git a/.bin/offlineimap b/.bin/offlineimap new file mode 100755 index 0000000..ad01298 --- /dev/null +++ b/.bin/offlineimap @@ -0,0 +1,17 @@ +#!/bin/sh +set -eu + +if ! test -t 0; then + echo Renicing because we are not run interactively… >&2 + renice 20 -p $$ >/dev/null + ionice -c2 -n7 -p $$ +fi + +ret=0 +/usr/bin/offlineimap -o "$@" || ret=$? + +if [ -x "$(command -v notmuch)" ]; then + notmuch new +fi + +exit $ret diff --git a/.crontab.d/offlineimap b/.crontab.d/offlineimap index cfbea97..907edc9 100644 --- a/.crontab.d/offlineimap +++ b/.crontab.d/offlineimap @@ -1,2 +1,2 @@ -*/15 * * * * sleep $((900 * $RANDOM / 32768)) && ip r | grep -q via && ionice -c3 nice -20 offlineimap -o -38 */4 * * * sleep $((60 * $RANDOM / 32768)) && ip r | grep -q via && ionice -c3 nice -20 offlineimap -oa logcheck +*/15 * * * * sleep $((900 * $RANDOM / 32768)) && ip r | grep -q via && $HOME/.bin/offlineimap +38 */4 * * * sleep $((60 * $RANDOM / 32768)) && ip r | grep -q via && $HOME/.bin/offlineimap -a logcheck