Advertisement
luisg_muniz

Script para llenar un FS (JFS2)

Jan 12th, 2018
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.46 KB | None | 0 0
  1. #!/bin/ksh93
  2. # Creates small files (1 block, 1/2 Kb) until it depletes the $1 mount point
  3. dir=${1:="/test512"}
  4. [ "${dir}" = "$(df ${dir} 2>/dev/null | awk 'NR>1 {print $NF}')" ] \
  5.     || { echo "Error: ${dir} is not a mount point" 1>&2; exit 1; }
  6.  
  7. trap 'tput rmso; print; print ; df ${dir}' EXIT
  8. tput smso
  9. for ((i=0; 1==1; i++))
  10. do
  11.     tput sc
  12.     dd if=/dev/zero of=/${dir}/file-${i} count=1 2> /dev/null || break
  13.     printf "%06d" ${i}
  14.     tput rc
  15. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement