Created
November 23, 2018 22:18
-
-
Save mailinglists35/81011ec29bfe02d45f5b8956091e25e7 to your computer and use it in GitHub Desktop.
speed up dd_rhelp
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
# cat `which watch_dd_rhelper` | |
#!/bin/bash | |
PREVIOUS=/tmp/previous | |
LAST=/tmp/last | |
reset=false | |
while true; do | |
[ "$reset" == "false" ] || reset=false | |
cat /proc/$(pidof dd_rescue)/io > $PREVIOUS | |
sleep 10 | |
cat /proc/$(pidof dd_rescue)/io > $LAST | |
if [ "x$(diff -q $PREVIOUS $LAST)" == "x" ]; then | |
kill -SIGINT $(pidof dd_rescue) | |
reset=true | |
echo -n "dd_rescue hung, restarting..." | |
else echo -n "ok..." | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
no data read in 10 seconds => give up and try a different area.