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:
12
ansible/roles/zfs/files/zfs_clone_recv.bash
Normal file
12
ansible/roles/zfs/files/zfs_clone_recv.bash
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/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 )"
|
||||
|
||||
# -s if the stream is interrupted, save the partial stream. The stream can then be resumed by doing a zfs send -t token where token is the receive_resume_token prop on the dataset we received into.
|
||||
# -u Do not mount the filesystem we are receiving. We can always mount afterwards but this avoids issues with streams with mountpoints to places like /
|
||||
zfs recv -s -u
|
||||
|
||||
# To delete an interrupted recv, run `zfs receive -A dataset`
|
||||
Reference in New Issue
Block a user