Add scripts for zfs send and recv for making full clones.
I most often need to make full clones when doing zfs send or recv so this writes down all the flags I prefer to use in a script so I do not forget them.
This commit is contained in:
16
ansible/roles/zfs/files/zfs_clone_send.bash
Normal file
16
ansible/roles/zfs/files/zfs_clone_send.bash
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/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
|
||||
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)
|
||||
Reference in New Issue
Block a user