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,7 +1,7 @@
#!/bin/sh
PATH=$PATH:/usr/local/sbin
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH"
# Only call zfs-auto-snapshot if it's available
which zfs-auto-snapshot > /dev/null || exit 0
command -v zfs-auto-snapshot >/dev/null 2>&1 || exit 0
exec zfs-auto-snapshot --label daily --keep 31

View File

@@ -1,3 +1,3 @@
PATH="/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin"
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
*/15 * * * * root which zfs-auto-snapshot > /dev/null || exit 0 ; zfs-auto-snapshot --label quarterhour --keep 4
*/15 * * * * root command -v zfs-auto-snapshot >/dev/null 2>&1 && exec zfs-auto-snapshot --label quarterhour --keep 4

View File

@@ -1,7 +1,7 @@
#!/bin/sh
PATH=$PATH:/usr/local/sbin
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH"
# Only call zfs-auto-snapshot if it's available
which zfs-auto-snapshot > /dev/null || exit 0
command -v zfs-auto-snapshot >/dev/null 2>&1 || exit 0
exec zfs-auto-snapshot --label hourly --keep 24

View File

@@ -1,7 +1,7 @@
#!/bin/sh
PATH=$PATH:/usr/local/sbin
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH"
# Only call zfs-auto-snapshot if it's available
which zfs-auto-snapshot > /dev/null || exit 0
command -v zfs-auto-snapshot >/dev/null 2>&1 || exit 0
exec zfs-auto-snapshot --label monthly --keep 12

View File

@@ -1,7 +1,7 @@
#!/bin/sh
PATH=$PATH:/usr/local/sbin
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH"
# Only call zfs-auto-snapshot if it's available
which zfs-auto-snapshot > /dev/null || exit 0
command -v zfs-auto-snapshot >/dev/null 2>&1 || exit 0
exec zfs-auto-snapshot --label weekly --keep 12