machine_setup/ansible/roles/zfs/files/zfs_clone_send.bash
2023-05-03 00:15:33 -04:00

17 lines
702 B
Bash

#!/usr/bin/env bash
#
# A zfs-send alias that creates a perfect clone with good defaults.
set -euo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# TODO: Do we want --backup ?
# We get --props automatically from --replicate
exec zfs send --compressed --replicate --large-block --embed --verbose "${@}"
# On zfs recv side, may want to pass `-s` to make the stream resumable.
# If the data is encrypted and you DONT want to decrypt it, pass the --raw flag on the send side
# You may need to remove --embed above for encrypted datasets (maybe only with --raw flag? very unsure)
# For unencrypted datasets, --raw will be equivalent to -Lec (large block, embed, compressed)