Skip to content

Commit 277287f

Browse files
committed
Further cron logic cleanups
1 parent d49be6a commit 277287f

File tree

5 files changed

+13
-9
lines changed

5 files changed

+13
-9
lines changed

etc/zfs-auto-snapshot.cron.daily

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/bin/sh
22

33
# Only call zfs-auto-snapshot if it's available
4-
which zfs-auto-snapshot > /dev/null && \
5-
exec zfs-auto-snapshot --quiet --syslog --label=daily --keep=31 //
4+
which zfs-auto-snapshot > /dev/null || exit 0
5+
6+
exec zfs-auto-snapshot --quiet --syslog --label=daily --keep=31 //
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
PATH="/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin"
22

3-
*/15 * * * * root which zfs-auto-snapshot > /dev/null && zfs-auto-snapshot --quiet --syslog --label=frequent --keep=4 //
3+
*/15 * * * * root which zfs-auto-snapshot > /dev/null || exit 0 ; zfs-auto-snapshot --quiet --syslog --label=frequent --keep=4 //

etc/zfs-auto-snapshot.cron.hourly

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/bin/sh
22

33
# Only call zfs-auto-snapshot if it's available
4-
which zfs-auto-snapshot > /dev/null && \
5-
exec zfs-auto-snapshot --quiet --syslog --label=hourly --keep=24 //
4+
which zfs-auto-snapshot > /dev/null || exit 0
5+
6+
exec zfs-auto-snapshot --quiet --syslog --label=hourly --keep=24 //

etc/zfs-auto-snapshot.cron.monthly

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/bin/sh
22

33
# Only call zfs-auto-snapshot if it's available
4-
which zfs-auto-snapshot > /dev/null && \
5-
exec zfs-auto-snapshot --quiet --syslog --label=monthly --keep=12 //
4+
which zfs-auto-snapshot > /dev/null || exit 0
5+
6+
exec zfs-auto-snapshot --quiet --syslog --label=monthly --keep=12 //

etc/zfs-auto-snapshot.cron.weekly

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/bin/sh
22

33
# Only call zfs-auto-snapshot if it's available
4-
which zfs-auto-snapshot > /dev/null && \
5-
exec zfs-auto-snapshot --quiet --syslog --label=weekly --keep=8 //
4+
which zfs-auto-snapshot > /dev/null || exit 0
5+
6+
exec zfs-auto-snapshot --quiet --syslog --label=weekly --keep=8 //

0 commit comments

Comments
 (0)