15-03-2019

This commit is contained in:
2019-03-15 20:20:37 +01:00
parent 53d2ce1c0d
commit 941984f1ee
52 changed files with 6416 additions and 70 deletions

View File

@@ -0,0 +1,33 @@
# Fabric SSH Python
Installer fabric et paramiko:
```bash
$ pip install fabric
$ pip install paramiko
# CryptographyDeprecationWarning
$ pip install cryptography==2.5
```
`fabfile.py`
```python
from fabric import Connection
c = Connection(host='192.168.1.7', user='bruno', port=42666)
result = c.run('uname -s')
result = c.put(local='/Users/bruno/test.csv', remote='/homes/bruno')
result = c.get(remote='/homes/bruno/httpd-vhost.conf', local='/Users/bruno/Downloads/')
result = c.get(remote='/homes/bruno/httpd-vhost.conf')
# erreur avec '/homes/bruno/hello.py'
result = c.run('python hello.py')
```