pastebin - collaborative debugging tool
nrubsig.kpaste.net RSS


work/fstest/fstest1.bash
Posted by Anonymous on Sun 12th Nov 2023 20:06
raw | new post

  1. #
  2. # work/fstest/fstest1.bash - filesystem copy/movie between mounts test1
  3. #
  4. # Written by Roland Mainz <roland.mainz@nrubsig.org>
  5. #
  6.  
  7. typeset i j
  8. typeset num_dirs=4
  9.  
  10. #set -o xtrace
  11. for ((i=0 ; i < num_dirs ; i++ )) ; do
  12.         mkdir -p "mnt$i/testdir/dir$i"
  13. done
  14.  
  15. #
  16. # add <num_dir mounts here>
  17. #
  18.  
  19. olddir="mnt0/testdir/dir0"
  20. touch "$olddir/file1.txt"
  21.  
  22. for ((i=1 ; i < 1000 ; i++)) ; do
  23.         (( j=i%num_dirs ))
  24.         newdir="mnt$j/testdir/dir$j/"
  25.         if true ; then
  26.                 mv "$olddir/file1.txt" "$newdir/file1.txt"
  27.         else
  28.                 cp "$olddir/file1.txt" "$newdir/file1.txt"
  29.                 rm "$olddir/file1.txt"
  30.         fi
  31.         olddir="$newdir"
  32. done
  33.  
  34.  
  35. md5sum "$olddir/file1.txt"
  36. rm "$olddir/file1.txt"
  37.  
  38. #
  39. # add <num_dir umounts here>
  40. #
  41.  
  42. #
  43. # cleanup
  44. #
  45.  
  46. for ((i=0 ; i < num_dirs ; i++ )) ; do
  47.         rmdir "mnt$i/testdir/dir$i"
  48.         rmdir "mnt$i/testdir"
  49.         rmdir "mnt$i"
  50. done
  51.  
  52. find . -ls
  53.  
  54. # EOF.

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at