Created
March 17, 2016 22:48
-
-
Save pfactum/2fc81e5ea08bae626e3a to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
folders_l1=10 | |
folders_l2=10 | |
files_l3=10000 | |
((total=folders_l1 * folders_l2 * files_l3)) | |
mount="/mnt/net/glusterfs/test" | |
index=0 | |
index_l1=0 | |
while [[ ${index_l1} -lt ${folders_l1} ]]; do | |
index_l2=0 | |
while [[ ${index_l2} -lt ${folders_l2} ]]; do | |
target="${mount}/${index_l1}/${index_l2}" | |
mkdir -p "${target}" | |
index_l3=0 | |
while [[ ${index_l3} -lt ${files_l3} ]]; do | |
echo -ne "${index}/${total} (${index_l1}/${folders_l1}, ${index_l2}/${folders_l2}, ${index_l3}/${files_l3})\r" | |
size=${RANDOM} | |
((size++)) | |
dd if=/dev/zero of=${target}/${index_l3} bs=${size} count=1 status=none | |
((index++)) | |
((index_l3++)) | |
done | |
((index_l2++)) | |
done | |
((index_l1++)) | |
done | |
echo -ne "\n" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment