Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am using a python script to launch remote linux commands from my local machine. The target(s) is/are a list of server(s). I am able to launch the commands no problem; however, the commands result in log files on the target. I would like to pull down these log files to my local machine after they are written (pull them down programmatically).

Is there a way I can "PULL" a file down from a remote machine via a secure connection in such a way that the transfer is initialized locally?

Thanks in advance!

share|improve this question

3 Answers 3

Yep. Scp is included with openssh. If you need to transfer multiple files you can also use rsync -e ssh

share|improve this answer
    
scp also supports transferring of multiple files. It even supports recursive directory transfers. –  Manuel Faux Jul 30 '09 at 18:33
scp remote.host:/path/to/file /some/local/path

Or use rsync.

share|improve this answer

The syntax for scp and rsync is always:

scp <source> <destination>

So it doesn't really matter which machine you do it from, the remote machine can either be the source or the destination. You do however, at least with rsync -e ssh, have to be on one of the two machines.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.