Last active
August 29, 2015 13:57
-
-
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 :)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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