shell script help - copy at most 7.5G from randomly chosen audio files

I wonder if I may get a little advice on the best tools/utilties to use to make a script that will:

  • take in a list of directories that contain audio files `find’ can do this]
  • randomly shuffle the list shuf' or sort’ can do this]
  • copy them to PMP personal-media-player cp' or rsync’]
  • stop when 7.5G have been transfered ???]

What would be the best way gauge how much data I’ve transferred? Does rsync provide this? Can I use a `while data -lt $MAXSIZE ]’ in some way?

This script needn’t be fool/bullet proof.

When you generate the list of files, output the file size also. Then write a script that will take this list of names and sizes, keep a running total of the bytes so far and stop outputting lines when 7.5G has been reached. You could refine it to round up the bytes to the next multiple of the block size on the destination device if you want to be more accurate.