Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

remote to remote file copy (driving me crazy!) 2

Status
Not open for further replies.

MKVAB

Programmer
Dec 2, 2003
86
US
The problem I'm having is I need a way (that requires no user intervention) to copy a file from a remote Windows box to a remote Linux box. I usually use pscp in my scripts, but I don't think pscp can do remote to remote. I've tried this:
Code:
pscp \\WindowsServer\filename username@[IP]:/home/dir/test.out -pw password'
The error I'm getting is:
Code:
Fatal: More than one remote source not supported

This makes sense if pscp doesn’t support remote to remote.

I can't figure this out for the life of me!!!!!

Anybody know a why to do this????


MK
 
copy it locally, then deploy it remotely?

<marc> i wonder what will happen if i press this...[ul][li]please tell us if our suggestion has helped[/li][li]need some help? faq581-3339[/li][/ul]
 
Thanks for the reply manarth. But copying down to that particular windows server isn't an option (unfortunately).

Other ideas?!?!?!

 
Mount one or the other on the local computer via SMB or NFS?

Or trigger a command on the Linux computer to copy the file itself?

 
Hummm, I don't know exactly what SMB is...but if you're suggesting copying it down to the local windows server, I am really trying to avoid doing that. Blast!

Having linux pick up the file and move it in is also not an option.

The way this is going to be used is MS SQL Server is writing out a file to a windows server. Then that file needs to be written out to the Linux directory as well. This all has to happen at the same time within the script...that's why having a process run on the linux box wont work for this scenario.

There's gotta be some sort of transfer utility out there that can handle remote-to-remote file copies across platforms. Right?!?!
 
Sure..scp or ftp.
You can automate these using expect.
 
SMB is &quot;Server Message Block&quot;, the protocol used by Windows to share resources. Check &quot;Samba&quot; for Linux. It's similar to NFS for Linux/Unix or NCP for NetWare. My point is that by mounting either of the resources on the local Linux computer, it would appear as a local directory and you could use scp, like
&quot;scp /mount/windows/filename user@ip:/remotedirectory&quot;

In fact, if you can copy from &quot;\\windowsshare\file&quot; to the local computer, I think you should already be able to mount \\windowsshare.

I don't see why my second suggestion wouldn't work either. A daemon runs on a remote server and waits to be called from a specified machine. When it is, it runs the requested program and returns the output and result code.

The &quot;nrpe&quot; plugin for Nagios ( is what I use for this. It can be used independently of the full monitoring system. An even simpler way might be to set up a service under inetd on the remote Linux computer.

Finally, it looks like you might be able have the Linux computer mount the Windows location where the file is written, and not copy it at all.

Just ideas. I'm not aware of a program for remote-remote copying, but agree that it would be useful here.
 
Thank you for all the information lgarner. I'll try out some of your suggestions.

-mk
 
if both computers are on a same network, even on the internet, secure copy from most ssh implementations ( scp ) could do the job if you setup your ssh server with the keys to your copying client.

_____________________________
when someone asks for your username and password, and much *clickely clickely* is happening in the background, know enough that you should be worried.
 
Thanks all for the help. I got it to work using pscp.

Code:
pscp -pw passwd \\WindowsServer\Dir1\test.out username@IP:/home/users/dir/test.out

-mk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top