madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Switch to using systemd-controlled persistent offlineimap
authormartin f. krafft <madduck@madduck.net>
Thu, 31 Oct 2019 03:15:45 +0000 (16:15 +1300)
committermartin f. krafft <madduck@madduck.net>
Thu, 31 Oct 2019 03:15:45 +0000 (16:15 +1300)
.config/systemd/user/default.target.wants/offlineimap@madduck.net.service [new symlink]
.config/systemd/user/offlineimap@.service [new file with mode: 0644]
.crontab.d/offlineimap
.gitignore.d/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 (symlink)
index 0000000..9b25838
--- /dev/null
@@ -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 (file)
index 0000000..a3088f9
--- /dev/null
@@ -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
index 8d01b95cd8c4b9f24302e9794237f52ff171f6fc..d4c8fa60aa99f586e3d8b02fa84571cbe09ea8a5 100644 (file)
@@ -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
index 91edf56befca82c74e5149ada764ec2c8034ebc8..76a4e79c3a31681a80ae2b7e1064ee499aa32603 100644 (file)
@@ -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