Created
January 18, 2016 18:16
-
-
Save rianhunter/5952355a98064a02bafe to your computer and use it in GitHub Desktop.
Cron job to read randomly from 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/sh | |
for a in /dev/sd*1 | |
do | |
SECTORS=$(/sbin/blockdev --getsize $a) | |
SECTOR=$(python -c "import random; print random.randint(0, $SECTORS - 1);") | |
dd if=$a of=/dev/null iflag=direct skip=${SECTOR} bs=512 count=1 2>/dev/null & | |
done | |
wait |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment