about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCameron Nemo <camerontnorman@gmail.com>2018-09-01 17:52:19 -0700
committerLeah Neukirchen <leah@vuxu.org>2018-09-03 14:23:20 +0200
commitd44fd0169fcb9ba3debcaab38b526c7c7bf96d61 (patch)
tree31b083fe6ee54f4b3d5058270b0b941e7492ef2d
parent44fa475c6d9dcb4b2f2ba89f39f5e7227fb9eec7 (diff)
downloadsnooze-d44fd0169fcb9ba3debcaab38b526c7c7bf96d61.tar.gz
snooze-d44fd0169fcb9ba3debcaab38b526c7c7bf96d61.tar.xz
snooze-d44fd0169fcb9ba3debcaab38b526c7c7bf96d61.zip
sv: include runit service files to run cron drop-in scripts
Closes: #6 [via git-merge-pr]
-rw-r--r--sv/Makefile12
-rwxr-xr-xsv/snooze-daily/finish2
-rwxr-xr-xsv/snooze-daily/run3
-rwxr-xr-xsv/snooze-hourly/finish2
-rwxr-xr-xsv/snooze-hourly/run3
-rwxr-xr-xsv/snooze-monthly/finish2
-rwxr-xr-xsv/snooze-monthly/run3
-rwxr-xr-xsv/snooze-weekly/finish2
-rwxr-xr-xsv/snooze-weekly/run3
9 files changed, 32 insertions, 0 deletions
diff --git a/sv/Makefile b/sv/Makefile
new file mode 100644
index 0000000..d97cc39
--- /dev/null
+++ b/sv/Makefile
@@ -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
index 0000000..a080f71
--- /dev/null
+++ b/sv/snooze-daily/finish
@@ -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
index 0000000..1e6ce55
--- /dev/null
+++ b/sv/snooze-daily/run
@@ -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
index 0000000..8a364b5
--- /dev/null
+++ b/sv/snooze-hourly/finish
@@ -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
index 0000000..6dc1f73
--- /dev/null
+++ b/sv/snooze-hourly/run
@@ -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
index 0000000..7188324
--- /dev/null
+++ b/sv/snooze-monthly/finish
@@ -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
index 0000000..2497fb3
--- /dev/null
+++ b/sv/snooze-monthly/run
@@ -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
index 0000000..8f61339
--- /dev/null
+++ b/sv/snooze-weekly/finish
@@ -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
index 0000000..3a18e74
--- /dev/null
+++ b/sv/snooze-weekly/run
@@ -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