Under Linux (e.g., Mac OS X), this is pretty easy with a shell script.
Assuming that your USB drives (and only your USB drives) are mounted in /media
, you can use a simple for loop:
for device in /media/*; do
// copy instructions here
// e.g., cp file "$device"
done
If you have 10 USB slots, this will allow you to process 10 drives at once.
The above for loop will copy the files sequentially, i.e., it will process the first flash drive, then start with the second one. If you have to copy a large amount of data, you can also copy the files in parallel:
unset PIDS
for device in /media/*; do
// a single copy instruction here
// e.g., cp file1 file2 file 3 "$device" &
done
wait
The ampersand after the copy instruction makes it execute in the background, i.e., the rest of the for loop is executed immediately. The command wait
delays the script until all background processes have finished.