Re: copy flies using ssh?

 
SOLVED
Go to solution
debian111
Regular Advisor

copy flies using ssh?

Hi all
how I can using ssh connected to machine X with ip xxx.xxx.xxx.xxx copy file to machine Y with ip address yyy.yyy.yyy.yyy

thank you
6 REPLIES 6
RAC_1
Honored Contributor
Solution

Re: copy flies using ssh?

You need to use scp.

scp "file_to_be_copied" remote_host:/dir_path/.
There is no substitute to HARDWORK
debian111
Regular Advisor

Re: copy flies using ssh?

Thank you very much :)))
Muthukumar_5
Honored Contributor

Re: copy flies using ssh?

You can as well as use sftp (secure ftp). It is having more options than scp. scp will not support wild card support with regexp as,

/remote/file_*.123 like that.

hth.
Easy to suggest when don't know about the problem!
Ivajlo Yanakiev
Respected Contributor

Re: copy flies using ssh?

when you use only scp you have preblem with small files.

better use tar to slove this isue.

#tar -zcf - /source_dir |ssh root@ip_dest_server tar -zxf - -C /dest_dir


Jared Middleton
Frequent Advisor

Re: copy flies using ssh?

Hi Muthukumar,

I'm not following your example. I've been using asterisk (*) wildcard with scp every day for years. Did you mean scp can't do "more complex" regular expressions than the example you showed?

Jared
Al_56
Regular Advisor

Re: copy flies using ssh?

If you wish to syncronize files between servers, you could do:

/usr/bin/rsync -avz --delete -e '/usr/bin/ssh' /targetDir user@destinationServer:/destinationDir

from the server you wish to syncronize from, or reverse the directory parms to pull from the target server.

Al