]> git.netwichtig.de Git - user/henk/code/snooze.git/commitdiff
sv: include runit service files to run cron drop-in scripts
authorCameron Nemo <camerontnorman@gmail.com>
Sun, 2 Sep 2018 00:52:19 +0000 (17:52 -0700)
committerLeah Neukirchen <leah@vuxu.org>
Mon, 3 Sep 2018 12:23:20 +0000 (14:23 +0200)
Closes: #6 [via git-merge-pr]
sv/Makefile [new file with mode: 0644]
sv/snooze-daily/finish [new file with mode: 0755]
sv/snooze-daily/run [new file with mode: 0755]
sv/snooze-hourly/finish [new file with mode: 0755]
sv/snooze-hourly/run [new file with mode: 0755]
sv/snooze-monthly/finish [new file with mode: 0755]
sv/snooze-monthly/run [new file with mode: 0755]
sv/snooze-weekly/finish [new file with mode: 0755]
sv/snooze-weekly/run [new file with mode: 0755]

diff --git a/sv/Makefile b/sv/Makefile
new file mode 100644 (file)
index 0000000..d97cc39
--- /dev/null
@@ -0,0 +1,12 @@
+DESTDIR=
+SYSCONFDIR=/etc
+SVDIR=$(SYSCONFDIR)/sv
+
+install: FRC
+       for f in daily hourly weekly monthly; do \
+               mkdir -p $(DESTDIR)$(SVDIR)/snooze-$$f; \
+               install -m0755 snooze-$$f/run snooze-$$f/finish \
+                       $(DESTDIR)$(SVDIR)/snooze-$$f/; \
+       done
+
+FRC:
diff --git a/sv/snooze-daily/finish b/sv/snooze-daily/finish
new file mode 100755 (executable)
index 0000000..a080f71
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec touch /var/cache/snooze/daily
diff --git a/sv/snooze-daily/run b/sv/snooze-daily/run
new file mode 100755 (executable)
index 0000000..1e6ce55
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+mkdir -p /var/cache/snooze
+exec snooze -s 1d -t /var/cache/snooze/daily -- run-parts --lsbsysinit /etc/cron.daily
diff --git a/sv/snooze-hourly/finish b/sv/snooze-hourly/finish
new file mode 100755 (executable)
index 0000000..8a364b5
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec touch /var/cache/snooze/hourly
diff --git a/sv/snooze-hourly/run b/sv/snooze-hourly/run
new file mode 100755 (executable)
index 0000000..6dc1f73
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+mkdir -p /var/cache/snooze
+exec snooze -H \* -s 1h -t /var/cache/snooze/hourly -- run-parts --lsbsysinit /etc/cron.hourly
diff --git a/sv/snooze-monthly/finish b/sv/snooze-monthly/finish
new file mode 100755 (executable)
index 0000000..7188324
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec touch /var/cache/snooze/monthly
diff --git a/sv/snooze-monthly/run b/sv/snooze-monthly/run
new file mode 100755 (executable)
index 0000000..2497fb3
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+mkdir -p /var/cache/snooze
+exec snooze -d 1 -s 28d -t /var/cache/snooze/monthly -- run-parts --lsbsysinit /etc/cron.monthly
diff --git a/sv/snooze-weekly/finish b/sv/snooze-weekly/finish
new file mode 100755 (executable)
index 0000000..8f61339
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec touch /var/cache/snooze/weekly
diff --git a/sv/snooze-weekly/run b/sv/snooze-weekly/run
new file mode 100755 (executable)
index 0000000..3a18e74
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+mkdir -p /var/cache/snooze
+exec snooze -w 0 -s 7d -t /var/cache/snooze/weekly -- run-parts --lsbsysinit /etc/cron.weekly