Fix zfs create commands.

This commit is contained in:
Otho 2022-11-20 20:15:43 -05:00
parent 2fc0aca8fd
commit 126c331608
Signed by: Otho
GPG Key ID: 16C720CD3BBE21D9

View File

@ -6,7 +6,7 @@
# <remote host 2 address> <host 2 ssh port> <host 2 root zfs> # <remote host 2 address> <host 2 ssh port> <host 2 root zfs>
# ... # ...
### datasets.txt (Only required for aggregator setup.) ### datasets.txt
# <dataset 1> # <dataset 1>
# <dataset 1>/<dataset 1a> # <dataset 1>/<dataset 1a>
# <dataset 1>/<dataset 1b> # <dataset 1>/<dataset 1b>
@ -33,12 +33,16 @@ setup_aggregator()
{ {
zfs allow -u ${BR_USER} send,snapshot,hold ${BR_ROOT} zfs allow -u ${BR_USER} send,snapshot,hold ${BR_ROOT}
for dataset in `cat datasets.txt`; do for dataset in `cat datasets.txt`; do
zfs create $dataset zfs create -p ${BR_ROOT}/$dataset
done done
} }
setup_mirror() setup_mirror()
{ {
zfs create -p $BR_ROOT
for dataset in `cat datasets.txt`; do
zfs create -p ${BR_ROOT}/$dataset
done
zfs allow -u ${BR_USER} send,snapshot,hold ${BR_ROOT} zfs allow -u ${BR_USER} send,snapshot,hold ${BR_ROOT}
zfs allow -u ${BR_USER} \ zfs allow -u ${BR_USER} \
compression,mountpoint,receive,create,mount ${BR_ROOT} compression,mountpoint,receive,create,mount ${BR_ROOT}
@ -52,7 +56,6 @@ create_snapshot()
else else
zfs snapshot -r ${BR_ROOT}@${id} zfs snapshot -r ${BR_ROOT}@${id}
fi fi
} }
send_single_snapshot() send_single_snapshot()