Created
August 8, 2012 10:12
-
-
Save muhqu/3293988 to your computer and use it in GitHub Desktop.
This file contains hidden or 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/bash | |
if [ -z "$1" ]; then | |
echo "Usage: sudo $0 /dev/sdh1" | |
exit 1; | |
fi | |
dd if=$1 of=/dev/null & pid=$! | |
while true; do | |
ps -p$pid --no-heading || break; | |
echo "-- $(date) ------------------"; | |
kill -USR1 $pid; | |
sleep 60s; | |
done | |
echo "-- $(date) ------------------"; | |
echo "DONE \o/" |
This file contains hidden or 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
$ sudo ./ebs-warmer.sh /dev/md1 | |
5667 pts/2 00:00:00 dd | |
-- Wed Aug 8 10:04:34 UTC 2012 ------------------ | |
4350+0 records in | |
4350+0 records out | |
2227200 bytes (2.2 MB) copied, 0.0102517 s, 217 MB/s | |
5667 pts/2 00:00:03 dd | |
-- Wed Aug 8 10:05:34 UTC 2012 ------------------ | |
1174177+0 records in | |
1174176+0 records out | |
601178112 bytes (601 MB) copied, 67.3422 s, 8.9 MB/s | |
5667 pts/2 00:00:05 dd | |
-- Wed Aug 8 10:06:34 UTC 2012 ------------------ | |
1895073+0 records in | |
1895072+0 records out | |
970276864 bytes (970 MB) copied, 127.779 s, 7.6 MB/s | |
5667 pts/2 00:00:07 dd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you are willing to add a dependency, you could run the dd through 'pipeviewer' http://www.ivarch.com/programs/pv.shtml which can show you the progress.