954,525 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

FTP or SSH in python

hey guys, first post.

I have a program that takes a file from a windows box, and FTP's it to a unix/linux box. The program works fine, however there is something i want to add to it. I want the program to send 2 commands to the unix box while im still connected to it:

1) a concatonate command [cat MASTERLOGFILE.txt newlogfile >temp] and
2) a copy command [cp temp MASTERLOGFILE.txt].

I have read that there is a ftp.sendcmd(command) command that transfers a command to the box that its connected to, however i get errors when running the above mentioned commands. Is it possible to do this? Should I create a new program that ssh's into the desired unix box and throws commands that way? Thanks for any help!

afireinside7710
Newbie Poster
1 post since Dec 2009
Reputation Points: 10
Solved Threads: 0
 

Hi!

ftp.sendcmd is only for FTP commands. Google gave me this: http://commandline.org.uk/python/sftp-python-really-simple-ssh/

programmersbook
Junior Poster
121 posts since Nov 2009
Reputation Points: 29
Solved Threads: 30
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: