Después de un tiempo sin postear, he vuelto, al menos por ahora!!
Estos días he necesitado varios conjuntos de archivos para realizar pruebas de rendimiento, y para generar estos, he creado el siguiente script, que ahora comparto con vosotros.
Espero que os sea de utilidad.
After some time without posting, I'm back!
This days I needed some sets of files to make some performance tests. To generate this files I wrote the following script that I'm going to share with all of you.
I hope you find it useful.
PS. I know, I know. My English is not good enought but, the more you help me, the more I learn.
#!/bin/bash # FILES_PATH="$PWD/files" # path to create de files declare -i DIR_NUM=13 # num. of dirs to create declare -i FILE_NUM=1000 # num. of files to create declare -i FILE_MIN_SIZE=10 # in kB declare -i FILE_MAX_SIZE=200 # in kB declare -i FILE_SIZE=$FILE_MAX_SIZE if [ ! -d $FILES_PATH ]; then mkdir $FILES_PATH fi for (( dir=1;dir<=$DIR_NUM;dir++ )); do mkdir "$FILES_PATH/dir_$dir" for (( file=1;file<=$FILE_NUM;file++ )); do FILE_SIZE=$(($RANDOM%(FILE_MAX_SIZE)-$FILE_MIN_SIZE))+$FILE_MIN_SIZE FILE_SIZE=$(($RANDOM%FILE_MAX_SIZE)) FILE_SIZE=$FILE_SIZE+$FILE_MIN_SIZE dd count=$FILE_SIZE if=/dev/zero of="$FILES_PATH/dir_$dir/file_$file" >> /dev/null 2>&1 done done
No hay comentarios:
Publicar un comentario