1

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!

3 Answers 3

1

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

1
  • scp also supports transferring of multiple files. It even supports recursive directory transfers. Jul 30, 2009 at 18:33
1
scp remote.host:/path/to/file /some/local/path

Or use rsync.

1

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.

You must log in to answer this question.