mirror of https://github.com/jimsalterjrs/sanoid
split snapshot taking/pruning into seperate units for debian package to prevent pruning blocking snapshot taking
This commit is contained in:
parent
22160deb8e
commit
fa3c511dc1
|
|
@ -16,4 +16,14 @@ override_dh_auto_install:
|
||||||
@mkdir -p $(DESTDIR)/usr/share/doc/sanoid; \
|
@mkdir -p $(DESTDIR)/usr/share/doc/sanoid; \
|
||||||
cp sanoid.conf $(DESTDIR)/usr/share/doc/sanoid/sanoid.conf.example;
|
cp sanoid.conf $(DESTDIR)/usr/share/doc/sanoid/sanoid.conf.example;
|
||||||
@mkdir -p $(DESTDIR)/lib/systemd/system; \
|
@mkdir -p $(DESTDIR)/lib/systemd/system; \
|
||||||
cp debian/sanoid.timer $(DESTDIR)/lib/systemd/system;
|
cp debian/sanoid-prune.service $(DESTDIR)/lib/systemd/system;
|
||||||
|
|
||||||
|
override_dh_installinit:
|
||||||
|
dh_installinit --noscripts
|
||||||
|
|
||||||
|
override_dh_systemd_enable:
|
||||||
|
dh_systemd_enable sanoid.timer
|
||||||
|
dh_systemd_enable sanoid-prune.service
|
||||||
|
|
||||||
|
override_dh_systemd_start:
|
||||||
|
dh_systemd_start sanoid.timer
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Cleanup ZFS Pool
|
||||||
|
Requires=zfs.target
|
||||||
|
After=zfs.target sanoid.service
|
||||||
|
ConditionFileNotEmpty=/etc/sanoid/sanoid.conf
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Environment=TZ=UTC
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=/usr/sbin/sanoid --prune-snapshots
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=sanoid.service
|
||||||
|
|
@ -7,4 +7,4 @@ ConditionFileNotEmpty=/etc/sanoid/sanoid.conf
|
||||||
[Service]
|
[Service]
|
||||||
Environment=TZ=UTC
|
Environment=TZ=UTC
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
ExecStart=/usr/sbin/sanoid --cron
|
ExecStart=/usr/sbin/sanoid --take-snapshots
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue