From b2d7cbe56d536ea303940d912566659663abcd69 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Sun, 3 Feb 2019 11:14:41 +0100 Subject: systemd service and timer files new --- .gitignore | 2 ++ Makefile | 4 +++- backup@.service.in | 8 ++++++++ backup@.timer.in | 10 ++++++++++ 4 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 backup@.service.in create mode 100644 backup@.timer.in diff --git a/.gitignore b/.gitignore index e0a3b50..08432d6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ backup +backup@.service +backup@.timer backupStatistics fastRepair lastBackups diff --git a/Makefile b/Makefile index 2b38491..7c08c7c 100644 --- a/Makefile +++ b/Makefile @@ -23,11 +23,12 @@ SHELL = /bin/bash DESTDIR = ETCDIR = /etc BINDIR = /usr/bin +LIBDIR = /usr/lib MANDIR = /usr/share/man VERSION = 1.3.1 -all: man.commons backup backup.1 backupStatistics backupStatistics.1 lastBackups lastBackups.1 removeOldBackups removeOldBackups.1 +all: man.commons backup backup.1 backup@.service backup@.timer backupStatistics backupStatistics.1 lastBackups lastBackups.1 removeOldBackups removeOldBackups.1 %: %.in sed " \ @@ -47,6 +48,7 @@ all: man.commons backup backup.1 backupStatistics backupStatistics.1 lastBackups install: all install -D -m0755 -t $(DESTDIR)$(BINDIR) backup backupStatistics lastBackups removeOldBackups + install -D -m0644 -t $(DESTDIR)$(LIBDIR)/systemd/system backup@.service backup@.timer install -D -m0644 -t $(DESTDIR)$(MANDIR)/man1 backup.1 backupStatistics.1 lastBackups.1 removeOldBackups.1 install -D -m0644 -t $(DESTDIR)$(ETCDIR) backup.conf diff --git a/backup@.service.in b/backup@.service.in new file mode 100644 index 0000000..c2410ac --- /dev/null +++ b/backup@.service.in @@ -0,0 +1,8 @@ +[Unit] +Description=Backup %I. +Requires=network-online.target local-fs.target +After=network-online.target local-fs.target + +[Service] +Type=simple +ExecStart=#BINDIR#/backup %I diff --git a/backup@.timer.in b/backup@.timer.in new file mode 100644 index 0000000..2056876 --- /dev/null +++ b/backup@.timer.in @@ -0,0 +1,10 @@ +[Unit] +Description=Periodically backup %I. + +[Timer] +AccuracySec=1us +RandomizedDelaySec=10min +OnCalendar=*-*-* *:00/10:00 + +[Install] +WantedBy=timers.target -- cgit v1.2.3-70-g09d2