I want to copy all files from remote host /root/files/*.logto my current directory - ./files1/
require 'rubygems'
require 'net/ssh'
require 'net/scp'
Net::SSH.start( scp_hostname, scp_username, :keys => scp_keys, :timeout => 360 ) do |ssh|
ssh.scp.download!( '/root/files/*.log', './files1/' )
ssh.exec!( .. )
ssh.exec!( .. )
end
I got an exception :
caught exception SCP did not finish successfully (1): scp: /root/files/*.log: No such file or directory
But it worked when I copied a specific file
ssh.scp.download!( '/root/files/myfile.log', './files1/' )
Can anyone help?
Thanks!