I wanted to compress a folder on a remote namchine.For that i am using paramiko.
But i don’t know how to do that using paramiko.
Any suggestions??
This is my code:
dpath = '/var/mysql/5.1/mysql.zip'
port = 22
host = '10.88.36.7'
transport = paramiko.Transport((host, port))
transport.connect(username=suser, password=spass)
channel = transport.open_channel(kind="session")
channel.exec_command('zip -r /var/db/mysql /var/db/mysql')
transport.close()
whats wrong in this??
After
You have to wait the termination of the command with:
Furthermore, you’re zip command is weird… don’t you want to say