TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: 998C22C5-AE3F-4008-AEB5-8
from: I R A DARTH AGGIE
date: 2017-02-14 18:43:00
subject: Re: SCP script with Pytho

On Mon, 13 Feb 2017 04:04:47 -0800 (PST),
Jack Lobingier , in
 wrote:

> I have an SCP script that auto completes just fine from the terminal
> window in Pi.  When I use either subprocess or os to try and have
> it run under Python it does not do the file transfer from Pi to my
> Ubuntu machine.  What am I doing wrong?  Here is the script:
>
>  from subprocess import call
>  cmd='scp -i id_rsa sample.txt jack@192.168.1.103 /home/jack/pi_data'
>  call (cmd.split ())

I'm guessing, but since it works from the command line but not from a
non-interactive mode, you might try this: scp -i ~/.ssh/id_rsa

--
Consulting Minister for Consultants, DNRC
I can please only one person per day. Today is not your day. Tomorrow
isn't looking good, either.
I am BOFH. Resistance is futile. Your network will be assimilated.

--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.