From: martin f. krafft Date: Thu, 31 Oct 2019 03:15:45 +0000 (+1300) Subject: Switch to using systemd-controlled persistent offlineimap X-Git-Url: https://git.madduck.net/etc/offlineimap.git/commitdiff_plain/a432b366efebdc9ae6e0757169e4a1cea70fa885?ds=inline Switch to using systemd-controlled persistent offlineimap --- diff --git a/.config/systemd/user/default.target.wants/offlineimap@madduck.net.service b/.config/systemd/user/default.target.wants/offlineimap@madduck.net.service new file mode 120000 index 0000000..9b25838 --- /dev/null +++ b/.config/systemd/user/default.target.wants/offlineimap@madduck.net.service @@ -0,0 +1 @@ +../offlineimap@.service \ No newline at end of file diff --git a/.config/systemd/user/offlineimap@.service b/.config/systemd/user/offlineimap@.service new file mode 100644 index 0000000..a3088f9 --- /dev/null +++ b/.config/systemd/user/offlineimap@.service @@ -0,0 +1,13 @@ +[Unit] +Description=Offlineimap Service for account %i +Documentation=man:offlineimap(1) + +[Service] +ExecStart=/usr/bin/offlineimap -a %i -u quiet +#StandardOutput=file:$RUNTIME_DIRECTORY/offlineimap +#StandardError=file:$RUNTIME_DIRECTORY/offlineimap +Restart=always +RestartSec=60 + +[Install] +WantedBy=default.target diff --git a/.crontab.d/offlineimap b/.crontab.d/offlineimap index 8d01b95..d4c8fa6 100644 --- a/.crontab.d/offlineimap +++ b/.crontab.d/offlineimap @@ -1,2 +1 @@ -*/30 * * * * sleep $((900 * $RANDOM / 32768)) && ip r | grep -q via && [ -e $VARDIR/offlineimap/madduck.net.lock ] || offlineimap -u Quiet -o -a madduck.net 55 */8 * * * sleep $((300 * $RANDOM / 32768)) && ip r | grep -q via && [ -e $VARDIR/offlineimap/madduck.net_bulk.lock ] || offlineimap -u Quiet -o -a madduck.net_bulk diff --git a/.gitignore.d/offlineimap b/.gitignore.d/offlineimap index 91edf56..76a4e79 100644 --- a/.gitignore.d/offlineimap +++ b/.gitignore.d/offlineimap @@ -1,10 +1,10 @@ * -!/.crontab.d +!/.config/systemd/user/default.target.wants/offlineimap@madduck.net.service +!/.config/systemd/user/offlineimap@.service !/.crontab.d/offlineimap -!/.offlineimap +!/.gitignore.d/offlineimap !/.offlineimap/.gitignore !/.offlineimap/helper.py +!/.offlineimap/known_hosts !/.offlineimaprc -!/.var -!/.var/offlineimap !/.var/offlineimap/.gitignore