Created
June 18, 2011 07:39
-
-
Save JakSprats/1032900 to your computer and use it in GitHub Desktop.
Bash script to thrash disk
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/bash | |
T=$(tempfile) | |
time sudo find /usr -type f| sort -R | head -n 4000 | sed -e "s/\ /\\\ /g" > $T | |
rm -f rand.files | |
I=0 | |
FILES="" | |
cat $T | while read file; do | |
if [ $I -lt 25 ]; then | |
FILES="$FILES $file" | |
I=$[${I}+1] | |
else | |
echo "$FILES" | |
I=0 | |
FILES="" | |
fi | |
done >> rand.files | |
cat rand.files | sort -r | while read file; do | |
taskset -c 0 md5sum ${file} & </dev/null; | |
done | |
echo LAUNCHED |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment