Shiva Krishna Bavandla
Shiva Krishna Bavandla

Reputation: 26668

converting the psftp command written on windows on to linux in python

I am working on python, actually i am trying to connect to sftp and get some files after connecting.

The process which i followed on windows is below

import os

psftpCmd='psftp sftp.example.com -l user -pw pass -b client_configurations\lifebridge.scr -batch'

os.system(psftpCmd)

The code in lifebrige.scr is

cd lifebridge
lcd feeds\lifebridge
get jobs.xml
bye

So i am able to fetch the file successfully i want to do the same process on linux(fedora) machine and i tried the following

import os

psftpCmd='psftp sftp.example.com -l user -pw pass -b client_configurations\lifebridge.scr -batch'
os.system(psftpCmd)

Result:

sh: psftp: command not found

Here i can expect that psftp is putty command so need to do something else on linux fro the same, Can anyone let me now how to write the same command in linux

Upvotes: 1

Views: 331

Answers (1)

Hans Then
Hans Then

Reputation: 11322

On Linux, the command is sftp.

Upvotes: 2

Related Questions