
January 31st, 2012, 05:10 AM
|
|
Registered User
|
|
Join Date: Jan 2012
Posts: 5
Time spent in forums: 1 h 28 m 5 sec
Reputation Power: 0
|
|
|
Copy files over scp without saving on HDD
Hello everybody,
I have to write a small app which should to upload files via ssh tunnel from one to another server. I wanna use python for now I'm stopped on this simple solution:
import os
import subprocess, shlex
cmd = "/usr/bin/scp -q /var/log/test.log logger@10.10.10.1:/tmp"
args = shlex.split(cmd)
p = subprocess.Popen(args)
out, err = p.communicate()
that's works.
next step is a solution, where I can create and copy files in the same way, but without writing files on HDD before copy it over scp
any ideas?
thanks in advance
|