View previous topic :: View next topic |
Author |
Message |
thomasvk Guru
Joined: 19 Mar 2005 Posts: 597
|
Posted: Sun Apr 26, 2009 4:39 pm Post subject: Copy file to multiple destinations with one read operation |
|
|
Does a tool exist to copy from one source to multiple destinations, with just one read operation? For example if I have a source (file or directory, doesn't matter) of 5GB it would take 10 minutes to copy it to one destination and then another 10 minutes to copy to another destination. However, if the source blocks are just read once, and then those blocks are written to the two destination locations simultaneously it would only take 10 minutes in total. I realize this would only be beneficial where the multiple destinations are actually on separate media (which is the case for me).
Of course in this example it's quite trivial but for me it's about several hundreds of gigabytes and takes multiple hours to copy, it would really save time: it would only take as long as the slowest destination volume. |
|
Back to top |
|
|
Sadako Advocate
Joined: 05 Aug 2004 Posts: 3792 Location: sleeping in the bathtub
|
Posted: Sun Apr 26, 2009 5:52 pm Post subject: |
|
|
Just cat the file to tee, which will copy it's input to as many output files as you specify.
Recursively copying will be trickier, but a shell script should work nicely.
I'm pretty sure I've seen a thread about this a few months ago, try searching for tee. _________________ "You have to invite me in" |
|
Back to top |
|
|
MaximeG l33t
Joined: 15 Apr 2008 Posts: 722 Location: Belgium
|
Posted: Sun Apr 26, 2009 6:07 pm Post subject: |
|
|
Yes,
dev-perl/IO-Tee should help you.
Although it would not be that simple to improve file operations speed. Only raid* are efficient for that kind of stuff.
Regards,
Maxime _________________ Future is wide open. |
|
Back to top |
|
|
|