diff options
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | Makefile | 3 | ||||
-rw-r--r-- | remove-old-backups.service.in | 8 | ||||
-rw-r--r-- | remove-old-backups.timer.in | 10 |
4 files changed, 22 insertions, 1 deletions
@@ -10,3 +10,5 @@ remove-old-backups man.commons *.common *.1 +remove-old-backups.service +remove-old-backups.timer @@ -35,6 +35,7 @@ all: man.commons \ backup-statistics backup-statistics.1 \ forwarddown forwarddown.1 \ last-backups last-backups.1 \ + remove-old-backups.service remove-old-backups.timer \ remove-old-backups remove-old-backups.1 %: %.in @@ -55,7 +56,7 @@ all: man.commons \ install: all install -D -m0755 -t $(DESTDIR)$(BINDIR) backup backup-progress backup-statistics forwarddown last-backups remove-old-backups - install -D -m0644 -t $(DESTDIR)$(LIBDIR)/systemd/system backup@.service backup@.timer + install -D -m0644 -t $(DESTDIR)$(LIBDIR)/systemd/system backup@.service backup@.timer remove-old-backups.service remove-old-backups.timer install -D -m0644 -t $(DESTDIR)$(MANDIR)/man1 backup.1 backup-statistics.1 forwarddown.1 last-backups.1 remove-old-backups.1 install -D -m0644 -t $(DESTDIR)$(ETCDIR) backup.conf install -D -m0755 -T sendmailadvanced.hook $(DESTDIR)$(ETCDIR)/sendmailadvanced.hooks/last-backups diff --git a/remove-old-backups.service.in b/remove-old-backups.service.in new file mode 100644 index 0000000..dea3649 --- /dev/null +++ b/remove-old-backups.service.in @@ -0,0 +1,8 @@ +[Unit] +Description=Remove old backups. +Requires=network-online.target local-fs.target +After=network-online.target local-fs.target + +[Service] +Type=simple +ExecStart=#BINDIR#/remove-old-backups diff --git a/remove-old-backups.timer.in b/remove-old-backups.timer.in new file mode 100644 index 0000000..673e18e --- /dev/null +++ b/remove-old-backups.timer.in @@ -0,0 +1,10 @@ +[Unit] +Description=Regularly remove old backups. + +[Timer] +AccuracySec=1us +RandomizedDelaySec=1day +OnCalendar=*-*-* 00:00:00 + +[Install] +WantedBy=timers.target |