Skip to content

Instantly share code, notes, and snippets.

@velenux
Created August 25, 2010 14:06
Show Gist options
  • Save velenux/549570 to your computer and use it in GitHub Desktop.
Save velenux/549570 to your computer and use it in GitHub Desktop.
#!/bin/bash
SRC=/home/velenux/c0ding/ # lots of small files, and some bigger ones mixed in
DEST=$1/velebench/
echo "Starting test: "
echo " - SRC: ${SRC}"
echo " - DEST: ${DEST}"
echo ""
for run in $(seq 1 3); do
echo "Running test #${run}..."
if [ ! -d $DEST ]; then
mkdir -p $DEST
fi
echo ' * rsync'
rsync -a ${SRC} $DEST &>/dev/null
sync
echo ' * mp3'
for mp3 in $(seq 1 20); do
dd if=/dev/urandom of=${DEST}/mp3-${mp3}.mp3 bs=1M count=4 &>/dev/null
done
sync
echo ' * 100mb file'
dd if=/dev/zero of=${DEST}/one.img bs=1M count=100 &>/dev/null
sync
echo ' * 1Gb file'
dd if=/dev/zero of=${DEST}/two.img bs=4M count=250 &>/dev/null
sync
echo ' * removing'
rm -rf $DEST/
sync
echo ''
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment