Skip to content

Commit 10c7f2f

Browse files
committed
use /usr/sbin/zfs everywhere so it works from cron
The snap[12]time checks had just 'zfs', which failed on cron jobs, which didn't have /usr/sbin in $PATH.
1 parent 5aa8a10 commit 10c7f2f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

zfs-backup.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,8 @@ do_backup() {
195195
fi
196196

197197
# sanity checking of snapshot times -- avoid going too far back with -r
198-
snap1time=$(zfs get -Hp -o value creation $DATASET@$snap1)
199-
snap2time=$(zfs get -Hp -o value creation $DATASET@$snap2)
198+
snap1time=$(/usr/sbin/zfs get -Hp -o value creation $DATASET@$snap1)
199+
snap2time=$(/usr/sbin/zfs get -Hp -o value creation $DATASET@$snap2)
200200
if [ $snap2time -lt $snap1time ]; then
201201
echo "Error: target snapshot $snap2 is older than $snap1!"
202202
echo "Did you go too far back with '-r'?"

0 commit comments

Comments
 (0)