Skip to content

Commit ccbeca9

Browse files
committed
more Details in README and changed the install folder for the scripts to /lib insted of /etc
1 parent 110e27e commit ccbeca9

File tree

2 files changed

+26
-12
lines changed

2 files changed

+26
-12
lines changed

Makefile

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@ install:
1919
install src/zfs-auto-snapshot.sh $(DESTDIR)$(PREFIX)/sbin/zfs-auto-snapshot
2020

2121
systemd:
22-
install -d $(DESTDIR)/etc/systemd/system/
23-
install timers/zfs-auto-snapshot-frequent.service $(DESTDIR)/etc/systemd/system/zfs-auto-snapshot-frequent.service
24-
install timers/zfs-auto-snapshot-frequent.timer $(DESTDIR)/etc/systemd/system/zfs-auto-snapshot-frequent.timer
25-
install timers/zfs-auto-snapshot-hourly.service $(DESTDIR)/etc/systemd/system/zfs-auto-snapshot-hourly.service
26-
install timers/zfs-auto-snapshot-hourly.timer $(DESTDIR)/etc/systemd/system/zfs-auto-snapshot-hourly.timer
27-
install timers/zfs-auto-snapshot-daily.service $(DESTDIR)/etc/systemd/system/zfs-auto-snapshot-daily.service
28-
install timers/zfs-auto-snapshot-daily.timer $(DESTDIR)/etc/systemd/system/zfs-auto-snapshot-daily.timer
29-
install timers/zfs-auto-snapshot-weekly.service $(DESTDIR)/etc/systemd/system/zfs-auto-snapshot-weekly.service
30-
install timers/zfs-auto-snapshot-weekly.timer $(DESTDIR)/etc/systemd/system/zfs-auto-snapshot-weekly.timer
31-
install timers/zfs-auto-snapshot-monthly.service $(DESTDIR)/etc/systemd/system/zfs-auto-snapshot-monthly.service
32-
install timers/zfs-auto-snapshot-monthly.timer $(DESTDIR)/etc/systemd/system/zfs-auto-snapshot-monthly.timer
22+
install -d $(DESTDIR)/lib/systemd/system/
23+
install timers/zfs-auto-snapshot-frequent.service $(DESTDIR)/lib/systemd/system/zfs-auto-snapshot-frequent.service
24+
install timers/zfs-auto-snapshot-frequent.timer $(DESTDIR)/lib/systemd/system/zfs-auto-snapshot-frequent.timer
25+
install timers/zfs-auto-snapshot-hourly.service $(DESTDIR)/lib/systemd/system/zfs-auto-snapshot-hourly.service
26+
install timers/zfs-auto-snapshot-hourly.timer $(DESTDIR)/lib/systemd/system/zfs-auto-snapshot-hourly.timer
27+
install timers/zfs-auto-snapshot-daily.service $(DESTDIR)/lib/systemd/system/zfs-auto-snapshot-daily.service
28+
install timers/zfs-auto-snapshot-daily.timer $(DESTDIR)/lib/systemd/system/zfs-auto-snapshot-daily.timer
29+
install timers/zfs-auto-snapshot-weekly.service $(DESTDIR)/lib/systemd/system/zfs-auto-snapshot-weekly.service
30+
install timers/zfs-auto-snapshot-weekly.timer $(DESTDIR)/lib/systemd/system/zfs-auto-snapshot-weekly.timer
31+
install timers/zfs-auto-snapshot-monthly.service $(DESTDIR)/lib/systemd/system/zfs-auto-snapshot-monthly.service
32+
install timers/zfs-auto-snapshot-monthly.timer $(DESTDIR)/lib/systemd/system/zfs-auto-snapshot-monthly.timer
3333
install -d $(DESTDIR)$(PREFIX)/share/man/man8
3434
install src/zfs-auto-snapshot.8 $(DESTDIR)$(PREFIX)/share/man/man8/zfs-auto-snapshot.8
3535
install -d $(DESTDIR)$(PREFIX)/sbin

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,21 @@ instead of cron.
4141
make systemd
4242
```
4343
44-
2. optionally edit `zfs-auto-snapshot-frequent.timer` to snapshot more often and `zfs-auto-snapshot-frequent.service` to keep more snapshots
44+
2. optionally edit `zfs-auto-snapshot-frequent.timer` to snapshot more often and `zfs-auto-snapshot-frequent.service` to keep more snapshots by:
45+
46+
```
47+
cp /lib/systemd/system/zfs-auto-snapshot-frequent.timer /usr/systemd/system/zfs-auto-snapshot-frequent.timer
48+
cp /lib/systemd/system/zfs-auto-snapshot-frequent.service /usr/systemd/system/zfs-auto-snapshot-frequent.service
49+
50+
# in zfs-auto-snapshot-frequent.timer change OnCalendar from '*:0/15' (every 15 minutes) to i.e. '*:0/5' (every 5 minutes)
51+
[Timer]
52+
OnCalendar=*:0/5
53+
54+
# in zfs-auto-snapshot-frequent.service the number in --keep should match the count of collected snapshots per hour (60/5 = 12)
55+
[Service]
56+
ExecStart=/usr/bin/zfs-auto-snapshot --quiet --syslog --label=frequent --keep=12 //
57+
```
58+
4559
3. enable zfs snapshots: `zfs set com.sun:auto-snapshot=true pool/dataset`
4660
4. enable timers:
4761

0 commit comments

Comments
 (0)