Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # A simple looping script to display the
- # resilvering progress of a specific pool.
- # Idea came from Technicus, and lots of Googling!
- # Ctrl + C to kill the script
- # Specify the name of the pool to monitor. Case sensitive!
- POOL=Pool_Name_Here
- # Define how often, in seconds, that the
- # screen refreshes. Decimals do work, but 1-2 seconds
- # should work best
- INTERVAL=2
- for (( ; ; ))
- do
- Percent=$(zpool status Tank | awk '/done/ {print $3}')
- TimeStarted=$(zpool status Tank | awk '/since/ {print $6, $7, $8, $10, $9}')
- ScanSpeed=$(zpool status $POOL | awk '/scanned/ {print substr($4, 1, length($4)-1)}')
- ScanTotal=$(zpool status $POOL | awk '/scanned/ {print $1}')
- IssueSpeed=$(zpool status $POOL | awk '/issued/ {print substr($8, 1, length($2)-1)}')
- IssueTotal=$(zpool status $POOL | awk '/issued/ {print $9}')
- Resilvered=$(zpool status $POOL | awk '/resilvered/ {print $1}')
- ETA=$(zpool status Tank | awk '/done/ {print $5, $6, $7}')
- clear
- echo "----------Resilver Progress-------------"
- echo "Pool: $POOL"
- echo "Started: $TimeStarted"
- echo "Progress: $Percent"
- echo "ETA: $ETA"
- echo "-----------Resilver Stats--------------"
- echo "Scan Speed: $ScanSpeed"
- echo "Amount Scanned: $ScanTotal"
- echo "Issue Speed: $IssueSpeed"
- echo "Amount Issued: $IssueTotal"
- echo "----------------------------------------"
- sleep $INTERVAL
- done
Advertisement
Add Comment
Please, Sign In to add comment