I have a several large files on optical media I would like to copy to multiple targets - in this case I have two hard drives attached to the same computer. Is there a utility that can function like:
copy source target1 target2 ... targetN
|
feedback
|
|
For single files you can use
or if you prefer the demoggified version:
You could probably combine this with Otherwise you might just have to set the multiple copy operations off in parallel as separate tasks and hope that the OS disk cache is bright and/or big enough that each of the parallel tasks used cached read data from the first instead of causing drive-head thrashing. Edit: | |||||||
feedback
|
|
For Windows: n2ncopy will do this:
For Linux: The
or use xargs:
Both of these will allow you to copy entire directories/multiple files. This is also discussed in this StackOverflow article. | |||||
|
feedback
|
|
In bash (Linux, Mac or Cygwin):
(tee copies it's input to STDOUT, so use redirection on the last target). In Windows, Cygwin is often overkill. Instead, you can just add the exes from the UnxUtils project, which include cat, tee, and many others. | |||
|
feedback
|
|
Copy the following code into a new text file and save it as "mycopy.bat"
Copy this file to your \windows directory, Now, bring the command prompt the type : mycopy < source > < target 1 > < target 2 > < target 3 > .. < target 9 > PS: limitation for only 9 arguments. | |||
feedback
|
|
In bash:
| |||||
feedback
|
|
Ryan Thompson's solution:
makes a lot of sense: If write speed of the destination dirs is approximately the same then srcfile will only be read once from disk. The rest of the time it will be read from cache. I would make it a bit more general, so you also get subdirs:
If the write speed of the dest dirs are very different (e.g. one is on a ram disk and the other on NFS), then you may see that the parts of srcdir read while copying srcdir to dest1 is no longer in the disk cache when writing dest2. | |||
|
feedback
|