safer implementation

This commit is contained in:
2026-10-10 17:12:17 +02:00
parent 4a8181edc8
commit 9e698ca02a
8 changed files with 174 additions and 138 deletions

View File

@@ -1,3 +1,5 @@
.PHONY: all install uninstall
all:
install:
@@ -7,20 +9,20 @@ install:
install -d /etc/cron.weekly
install -d /etc/cron.monthly
install -m 0644 etc/zfs-auto-snapshot.cron.frequent /etc/cron.d/zfs-auto-snapshot
install -m 0744 etc/zfs-auto-snapshot.cron.hourly /etc/cron.hourly/zfs-auto-snapshot
install -m 0744 etc/zfs-auto-snapshot.cron.daily /etc/cron.daily/zfs-auto-snapshot
install -m 0744 etc/zfs-auto-snapshot.cron.weekly /etc/cron.weekly/zfs-auto-snapshot
install -m 0744 etc/zfs-auto-snapshot.cron.monthly /etc/cron.monthly/zfs-auto-snapshot
install -m 0755 etc/zfs-auto-snapshot.cron.hourly /etc/cron.hourly/zfs-auto-snapshot
install -m 0755 etc/zfs-auto-snapshot.cron.daily /etc/cron.daily/zfs-auto-snapshot
install -m 0755 etc/zfs-auto-snapshot.cron.weekly /etc/cron.weekly/zfs-auto-snapshot
install -m 0755 etc/zfs-auto-snapshot.cron.monthly /etc/cron.monthly/zfs-auto-snapshot
install -d /usr/local/sbin
install -m 0744 src/zfs-auto-snapshot.sh /usr/local/sbin/zfs-auto-snapshot
install -m 0755 src/zfs-auto-snapshot.sh /usr/local/sbin/zfs-auto-snapshot
uninstall:
rm /etc/cron.d/zfs-auto-snapshot
rm /etc/cron.hourly/zfs-auto-snapshot
rm /etc/cron.daily/zfs-auto-snapshot
rm /etc/cron.weekly/zfs-auto-snapshot
rm /etc/cron.monthly/zfs-auto-snapshot
rm /usr/local/sbin/zfs-auto-snapshot
rm -f /etc/cron.d/zfs-auto-snapshot
rm -f /etc/cron.hourly/zfs-auto-snapshot
rm -f /etc/cron.daily/zfs-auto-snapshot
rm -f /etc/cron.weekly/zfs-auto-snapshot
rm -f /etc/cron.monthly/zfs-auto-snapshot
rm -f /usr/local/sbin/zfs-auto-snapshot