forked from extern/zfs-auto-snapshot
Split the cron file for anacron compatibilty.
Split the cron file so that the hourly, daily, weekly, and monthly zfs automatic snapshots still happen even if the system is offline temporarily during the scheduled event, such as during a reboot. On Debian systems, if anacron is installed, then it is used to run the /etc/cron.{hourly,daily,weekly,monthly} directories, but not the /etc/cron.d directory. This means that /etc/cron.d jobs are not run if the system is offline when crond would usually invoke them.
This commit is contained in:
parent
5ce7a23384
commit
4b7609791b
10
Makefile
10
Makefile
@ -2,6 +2,14 @@ all:
|
||||
|
||||
install:
|
||||
install -d $(DESTDIR)$(PREFIX)/etc/cron.d
|
||||
install etc/zfs-auto-snapshot.cron $(DESTDIR)$(PREFIX)/etc/cron.d/zfs-auto-snapshot
|
||||
install -d $(DESTDIR)$(PREFIX)/etc/cron.daily
|
||||
install -d $(DESTDIR)$(PREFIX)/etc/cron.hourly
|
||||
install -d $(DESTDIR)$(PREFIX)/etc/cron.weekly
|
||||
install -d $(DESTDIR)$(PREFIX)/etc/cron.monthly
|
||||
install etc/zfs-auto-snapshot.cron.frequent $(DESTDIR)$(PREFIX)/etc/cron.d/zfs-auto-snapshot
|
||||
install etc/zfs-auto-snapshot.cron.hourly $(DESTDIR)$(PREFIX)/etc/cron.daily/zfs-auto-snapshot
|
||||
install etc/zfs-auto-snapshot.cron.daily $(DESTDIR)$(PREFIX)/etc/cron.hourly/zfs-auto-snapshot
|
||||
install etc/zfs-auto-snapshot.cron.weekly $(DESTDIR)$(PREFIX)/etc/cron.weekly/zfs-auto-snapshot
|
||||
install etc/zfs-auto-snapshot.cron.monthly $(DESTDIR)$(PREFIX)/etc/cron.monthly/zfs-auto-snapshot
|
||||
install -d $(DESTDIR)$(PREFIX)/sbin
|
||||
install src/zfs-auto-snapshot.sh $(DESTDIR)$(PREFIX)/sbin/zfs-auto-snapshot
|
||||
|
2
etc/zfs-auto-snapshot.cron.daily
Normal file
2
etc/zfs-auto-snapshot.cron.daily
Normal file
@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
exec zfs-auto-snapshot --quiet --syslog --label=daily --keep=31 //
|
2
etc/zfs-auto-snapshot.cron.hourly
Normal file
2
etc/zfs-auto-snapshot.cron.hourly
Normal file
@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
exec zfs-auto-snapshot --quiet --syslog --label=hourly --keep=24 //
|
2
etc/zfs-auto-snapshot.cron.monthly
Normal file
2
etc/zfs-auto-snapshot.cron.monthly
Normal file
@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
exec zfs-auto-snapshot --quiet --syslog --label=monthly --keep=12 //
|
2
etc/zfs-auto-snapshot.cron.weekly
Normal file
2
etc/zfs-auto-snapshot.cron.weekly
Normal file
@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
exec zfs-auto-snapshot --quiet --syslog --label=weekly --keep=4 //
|
Loading…
Reference in New Issue
Block a user