Eric Walstad wrote:
Eric Brunson wrote:
Tom wrote:
I have a webfaction server (highly recommended btw) and I'm trying to
use automate some tasks over ssh but I'm not having much luck with
pyssh http://pyssh.sourceforge.net/ .
Some of the docs mention methods that don't exist in the version I
downloaded, such as pyssh.run.
I'm using windows vista (work pc). Any ideas?
I've never used pyssh, so I can't comment directly on your problems. We
use paramiko very successfully. It's well documented and has excellent
example code included with the source.
http://www.lag.net/paramiko/
Also have a look at pexpect which essentially wraps command line calls.
I use it to automate mysql backups on my webfaction account. Here's
the meat of the code:
import pexpect
cmd = "ssh [EMAIL PROTECTED] 'mysqldump --opt -p foodb > foodb.sql'"
child = pexpect.spawn(cmd)
# expect mysql to prompt for a db password
child.expect('Enter password: ')
# send the password
child.sendline("nottherealpassword")
Homepage:
http://www.noah.org/wiki/Pexpect
It looks like there is now a pexpect SSH module. I've not used it, just
FYI:
http://pexpect.sourceforge.net/pxssh.html
I hope that helps.
What's the path to ssh under windows vista? Paramiko is a pure python
implementation of the SSH protocol, so it should run on any platform.
Besides, IMHO, expect, pexpect, Perl::Expect... the entire concept is a
horrible, horrible kludge and should only be used as a last resort when
no other interface is possible.
Your mileage may vary,
e.
|
_______________________________________________
Tutor maillist - [email protected]
http://mail.python.org/mailman/listinfo/tutor