Hi All,
I am running the following command to create a disk image of a server I want to virtualise. The command works fine but gives me a compressed image on the far side. I am trying to work out how to pipe things so that the output from ssh get's gunziped before being passed to dd.
The command is;
dd if=/dev/sda | gzip -1 - | ssh garethw@10.0.8.10 dd of=/home/garethw/image_sda.img
I know I can just gunzip at the remote end once the transfer is complete but I would prefer to do it in 1 hit if it's possible.
I've tried various combinations of adding
gunzip - |
gzip -d |
cat | gzip -d |
cat | gzip - |
after the IP and before the dd command but have not managed to get anything working.
Anyone have any ideas?
I am running the following command to create a disk image of a server I want to virtualise. The command works fine but gives me a compressed image on the far side. I am trying to work out how to pipe things so that the output from ssh get's gunziped before being passed to dd.
The command is;
dd if=/dev/sda | gzip -1 - | ssh garethw@10.0.8.10 dd of=/home/garethw/image_sda.img
I know I can just gunzip at the remote end once the transfer is complete but I would prefer to do it in 1 hit if it's possible.
I've tried various combinations of adding
gunzip - |
gzip -d |
cat | gzip -d |
cat | gzip - |
after the IP and before the dd command but have not managed to get anything working.
Anyone have any ideas?