Skip to content

Commit 0378234

Browse files
committed
Auto snapshot timers are statically configured
1 parent 056f9cd commit 0378234

11 files changed

+22
-50
lines changed

Makefile

Lines changed: 22 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,27 @@
11
PREFIX := /usr/local
2-
SYSTEMD_HOME := /lib/systemd/system
2+
SYSTEMD_HOME := $(PREFIX)/lib/systemd/system
3+
34
all:
5+
.PHONY: all
46

57
install:
6-
install -d $(DESTDIR)/etc/cron.d
7-
install -d $(DESTDIR)/etc/cron.daily
8-
install -d $(DESTDIR)/etc/cron.hourly
9-
install -d $(DESTDIR)/etc/cron.weekly
10-
install -d $(DESTDIR)/etc/cron.monthly
11-
install -m 0644 etc/zfs-auto-snapshot.cron.frequent $(DESTDIR)/etc/cron.d/zfs-auto-snapshot
12-
install etc/zfs-auto-snapshot.cron.hourly $(DESTDIR)/etc/cron.hourly/zfs-auto-snapshot
13-
install etc/zfs-auto-snapshot.cron.daily $(DESTDIR)/etc/cron.daily/zfs-auto-snapshot
14-
install etc/zfs-auto-snapshot.cron.weekly $(DESTDIR)/etc/cron.weekly/zfs-auto-snapshot
15-
install etc/zfs-auto-snapshot.cron.monthly $(DESTDIR)/etc/cron.monthly/zfs-auto-snapshot
16-
install -d $(DESTDIR)$(PREFIX)/share/man/man8
17-
install src/zfs-auto-snapshot.8 $(DESTDIR)$(PREFIX)/share/man/man8/zfs-auto-snapshot.8
18-
install -d $(DESTDIR)$(PREFIX)/sbin
19-
install src/zfs-auto-snapshot.sh $(DESTDIR)$(PREFIX)/sbin/zfs-auto-snapshot
8+
install -d $(DESTDIR)$(PREFIX)/sbin $(DESTDIR)$(PREFIX)/share/man/man8
9+
install -m 0755 src/zfs-auto-snapshot.sh $(DESTDIR)$(PREFIX)/sbin/zfs-auto-snapshot
10+
install -m 0422 -t $(DESTDIR)$(PREFIX)/share/man/man8 src/zfs-auto-snapshot.8
11+
install -m 0422 -t $(DESTDIR)$(SYSTEMD_HOME) \
12+
timers/zfs-auto-snapshot-daily.service \
13+
timers/zfs-auto-snapshot-daily.timer \
14+
timers/zfs-auto-snapshot-frequent.service \
15+
timers/zfs-auto-snapshot-frequent.timer \
16+
timers/zfs-auto-snapshot-hourly.service \
17+
timers/zfs-auto-snapshot-hourly.timer \
18+
timers/zfs-auto-snapshot-monthly.service \
19+
timers/zfs-auto-snapshot-monthly.timer \
20+
timers/zfs-auto-snapshot-weekly.service \
21+
timers/zfs-auto-snapshot-weekly.timer \
22+
timers/zfs-auto-snapshot.target
23+
.PHONY: install
2024

21-
systemd:
22-
install -d $(DESTDIR)$(PREFIX)$(SYSTEMD_HOME)
23-
install timers/zfs-auto-snapshot-frequent.service $(DESTDIR)/$(SYSTEMD_HOME)/zfs-auto-snapshot-frequent.service
24-
install timers/zfs-auto-snapshot-frequent.timer $(DESTDIR)/$(SYSTEMD_HOME)/zfs-auto-snapshot-frequent.timer
25-
install timers/zfs-auto-snapshot-hourly.service $(DESTDIR)/$(SYSTEMD_HOME)/zfs-auto-snapshot-hourly.service
26-
install timers/zfs-auto-snapshot-hourly.timer $(DESTDIR)/$(SYSTEMD_HOME)/zfs-auto-snapshot-hourly.timer
27-
install timers/zfs-auto-snapshot-daily.service $(DESTDIR)/$(SYSTEMD_HOME)/zfs-auto-snapshot-daily.service
28-
install timers/zfs-auto-snapshot-daily.timer $(DESTDIR)/$(SYSTEMD_HOME)/zfs-auto-snapshot-daily.timer
29-
install timers/zfs-auto-snapshot-weekly.service $(DESTDIR)/$(SYSTEMD_HOME)/zfs-auto-snapshot-weekly.service
30-
install timers/zfs-auto-snapshot-weekly.timer $(DESTDIR)/$(SYSTEMD_HOME)/zfs-auto-snapshot-weekly.timer
31-
install timers/zfs-auto-snapshot-monthly.service $(DESTDIR)/$(SYSTEMD_HOME)/zfs-auto-snapshot-monthly.service
32-
install timers/zfs-auto-snapshot-monthly.timer $(DESTDIR)/$(SYSTEMD_HOME)/zfs-auto-snapshot-monthly.timer
33-
install timers/zfs-auto-snapshot.target $(DESTDIR)$(PREFIX)$(SYSTEMD_HOME)/zfs-auto-snapshot.target
34-
install -d $(DESTDIR)$(PREFIX)/share/man/man8
35-
install src/zfs-auto-snapshot.8 $(DESTDIR)$(PREFIX)/share/man/man8/zfs-auto-snapshot.8
36-
install -d $(DESTDIR)$(PREFIX)/sbin
37-
install src/zfs-auto-snapshot.sh $(DESTDIR)$(PREFIX)/sbin/zfs-auto-snapshot
38-
systemctl enable zfs-auto-snapshot.target
39-
systemctl daemon-reload
40-
systemctl start zfs-auto-snapshot.target
25+
enable:
26+
systemctl enable --now zfs-auto-snapshot.target
27+
.PHONY: enable

etc/zfs-auto-snapshot.cron.daily

100755100644
File mode changed.

etc/zfs-auto-snapshot.cron.frequent

100755100644
File mode changed.

etc/zfs-auto-snapshot.cron.hourly

100755100644
File mode changed.

etc/zfs-auto-snapshot.cron.monthly

100755100644
File mode changed.

etc/zfs-auto-snapshot.cron.weekly

100755100644
File mode changed.

timers/zfs-auto-snapshot-daily.timer

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,3 @@ Description=ZFS daily snapshot timer
66
OnCalendar=daily
77
Persistent=true
88
RandomizedDelaySec=600
9-
10-
[Install]
11-
WantedBy=timers.target

timers/zfs-auto-snapshot-frequent.timer

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,3 @@ Description=ZFS frequent snapshot timer
66
OnCalendar=*:0/15
77
Persistent=true
88
RandomizedDelaySec=60
9-
10-
[Install]
11-
WantedBy=timers.target

timers/zfs-auto-snapshot-hourly.timer

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,3 @@ Description=ZFS hourly snapshot timer
66
OnCalendar=hourly
77
Persistent=true
88
RandomizedDelaySec=59
9-
10-
[Install]
11-
WantedBy=timers.target

timers/zfs-auto-snapshot-monthly.timer

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,3 @@ Description=ZFS monthly snapshot timer
66
OnCalendar=monthly
77
Persistent=true
88
RandomizedDelaySec=600
9-
10-
[Install]
11-
WantedBy=timers.target

0 commit comments

Comments
 (0)