diff options
author | Erich Eckner <git@eckner.net> | 2020-01-28 09:27:47 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2020-01-28 09:27:47 +0100 |
commit | 6be630c3465f3191e51b9a3e29c1036d58657610 (patch) | |
tree | 3f29d2106483b316a824dacbc6889f2dcf763209 | |
parent | 9228dc89ea22eb34ed3867e0d45c2bff181e95f4 (diff) | |
download | save-time-6be630c3465f3191e51b9a3e29c1036d58657610.tar.xz |
save-time-now newv0.1
-rw-r--r-- | Makefile | 8 | ||||
-rw-r--r-- | save-time-now.service.in | 6 | ||||
-rw-r--r-- | save-time-now.timer | 9 |
3 files changed, 19 insertions, 4 deletions
@@ -24,9 +24,9 @@ BINDIR = /usr/bin CACHEDIR = /var/cache SYSTEMDDIR = /usr/lib/systemd/system -VERSION = 0.0 +VERSION = 0.1 -all: save-time save-time.service +all: save-time save-time.service save-time-now.service %: %.in sed "s/#VERSION#/$(VERSION)/; s@#BINDIR#@$(BINDIR)@; s@#CACHEDIR#@$(CACHEDIR)@" $< > $@ @@ -36,10 +36,10 @@ all: save-time save-time.service install: all install -D -m0755 -t $(DESTDIR)$(BINDIR) save-time - install -D -m0644 -t $(DESTDIR)$(SYSTEMDDIR) save-time.service + install -D -m0644 -t $(DESTDIR)$(SYSTEMDDIR) save-time.service save-time-now.service save-time-now.timer clean: - rm -f save-time save-time.service + rm -f save-time save-time.service save-time-now.service dist: clean git status --porcelain 2> /dev/null | grep -q "\S" && (git add .; git commit -m"neue Version: $(VERSION)") || true diff --git a/save-time-now.service.in b/save-time-now.service.in new file mode 100644 index 0000000..e033620 --- /dev/null +++ b/save-time-now.service.in @@ -0,0 +1,6 @@ +[Unit] +Description=Save time now for next boot + +[Service] +Type=oneshot +ExecStart=#BINDIR#/save-time stop diff --git a/save-time-now.timer b/save-time-now.timer new file mode 100644 index 0000000..db5ee51 --- /dev/null +++ b/save-time-now.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Save time every hour for next boot + +[Timer] +RandomizedDelaySec=1h +OnCalendar=*-*-* 00:00:00 + +[Install] +WantedBy=timers.target |