P
Pim Snel
Hi,
I'm trying to figure out how to use a pipe with the net/ssh class. I
want to rubify a shell command to copy a lvm volume to another machine.
The command is:
dd if=/dev/system/lvmvolume | ssh -c blowfish root@remotehost dd
of=/dev/system/lvmvolume
So far i've come up with this:
----
c = Net::SSH.start( options[:destaddress], ort => 22, :username =>
'root', assword => remoterootpass )
c.open_channel do |channel|
channel.exec("dd of=/root/test.img") do |ch, success|
channel.on_data do |ch,data|
res << data
end
channel.send_data `dd if=#{options[:locallvmdevice]} 2>&1 /dev/null`
channel.eof!
end
end
c.loop
I'm trying to figure out how to use a pipe with the net/ssh class. I
want to rubify a shell command to copy a lvm volume to another machine.
The command is:
dd if=/dev/system/lvmvolume | ssh -c blowfish root@remotehost dd
of=/dev/system/lvmvolume
So far i've come up with this:
----
c = Net::SSH.start( options[:destaddress], ort => 22, :username =>
'root', assword => remoterootpass )
c.open_channel do |channel|
channel.exec("dd of=/root/test.img") do |ch, success|
channel.on_data do |ch,data|
res << data
end
channel.send_data `dd if=#{options[:locallvmdevice]} 2>&1 /dev/null`
channel.eof!
end
end
c.loop