File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 1
- #! /bin/ksh
1
+ #! /usr/ bin/env ksh
2
2
# /usr/xpg4/bin/sh and /bin/bash also work; /bin/sh does not
3
3
4
4
# backup script to replicate a ZFS filesystem and its children to another
@@ -64,6 +64,8 @@ LOCK="/var/tmp/zfsbackup.lock"
64
64
PID=" /var/tmp/zfsbackup.pid"
65
65
CFG=" /var/lib/zfssnap/zfs-backup.cfg"
66
66
ZFS=" /usr/sbin/zfs"
67
+ # Replace with sudo(8) if pfexec(1) is not available on your OS
68
+ PFEXEC=` which pfexec`
67
69
68
70
# local settings -- datasets to back up are now found by property
69
71
TAG=" zfs-auto-snap_daily"
@@ -231,10 +233,10 @@ do_backup() {
231
233
fi
232
234
233
235
if [ $DEBUG ]; then
234
- echo " would run: $ZFS send -R -I $snap1 $DATASET @$snap2 |"
235
- echo " $REMZFS_CMD recv $RECV_OPT -vF $REMPOOL "
236
+ echo " would run: $PFEXEC $ ZFS send -R -I $snap1 $DATASET @$snap2 |"
237
+ echo " $REMZFS_CMD recv $VERBOSE $ RECV_OPT -F $REMPOOL "
236
238
else
237
- if ! pfexec $ZFS send -R -I $snap1 $DATASET @$snap2 | \
239
+ if ! $PFEXEC $ZFS send -R -I $snap1 $DATASET @$snap2 | \
238
240
$REMZFS_CMD recv $VERBOSE $RECV_OPT -F $REMPOOL ; then
239
241
echo 1>&2 " Error sending snapshot."
240
242
touch $LOCK
You can’t perform that action at this time.
0 commit comments