Skip to content

Instantly share code, notes, and snippets.

@wolph
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wolph/9449280 to your computer and use it in GitHub Desktop.
Save wolph/9449280 to your computer and use it in GitHub Desktop.
Simple script to copy zfs vdevs (partitions) from one zpool to another with a progress bar :)
#!/bin/sh
source=$1
dest=$2
snapshot=$3
size=$(zfs send -nP $source@$snapshot 2>&1 | grep size | awk '{print $2}')
echo "$source@$snapshot -> $dest: $size"
zfs send $source@$snapshot | pv --timer --progress --eta --rate --average-rate --bytes --size $size --cursor --name $source | zfs receive -Fvu $dest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment