After a long time without posting on the blog here I come again with a tiny command line that can speed up the usual method of copying large amounts of data.

Sometime ago a college gave me a DVD that I would like to keep to myself but that other 2 colleges wanted too. I used dd, cat and ssh for the task. Taking less that 5 minutes to do it all.

First I started the .iso creation with dd:

dd if=/dev/cdrom of=/home/pedro/my_new_iso.iso

In other console you may start the copy of the iso file even if the iso it’s fully copied to the hard drive (just give a few seconds to have some data copied to the drive):

(cat /home/pedro/my_new_iso.iso | ssh user@remote.host.local dd of=~/my_new_iso.iso) ; (cat /home/pedro/my_new_iso.iso | ssh user2@remote2.host.local dd of=~/my_new_iso.iso)

The only thing you need to guarantee is that the first command ends before the second one.
See you all next time