photocopier 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/README.md +14 -9
- data/lib/photocopier/ssh.rb +1 -0
- data/lib/photocopier/version.rb +1 -1
- metadata +1 -1
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -39,6 +39,9 @@ ssh.put('foobar!', 'remote_file.txt')
|
|
39
39
|
# uploads a file
|
40
40
|
ssh.put('./local_file.txt', 'remote_file.txt')
|
41
41
|
|
42
|
+
# deletes a file
|
43
|
+
ssh.delete('remote_file.txt')
|
44
|
+
|
42
45
|
# mirros the remote directory into the local machine (needs rsync on the local machine)
|
43
46
|
ssh.get_directory('remote_dir', './local_dir')
|
44
47
|
|
@@ -60,9 +63,9 @@ all).
|
|
60
63
|
}
|
61
64
|
```
|
62
65
|
For performance reasons, the `.get_directory` and `.put_directory` commands make
|
63
|
-
use of `lftp
|
66
|
+
use of `lftp`, so you need to have it installed on your machine.
|
64
67
|
|
65
|
-
## SSH
|
68
|
+
## SSH
|
66
69
|
|
67
70
|
`Photocopier::SSH.new` accepts the following parameters (you DON'T need
|
68
71
|
to pass them all).
|
@@ -82,14 +85,16 @@ to pass them all).
|
|
82
85
|
}
|
83
86
|
```
|
84
87
|
|
85
|
-
|
86
|
-
|
88
|
+
For performance reasons, the `.get_directory` and `.put_directory` commands make
|
89
|
+
use of `rsync`, so you need to have it installed on your machine.
|
90
|
+
|
91
|
+
### Password gotchas
|
92
|
+
**TL;DR:** Avoid specifying the `password` argument on Photocopier::SSH, and
|
93
|
+
use more secure and reliable ways to authenticate (`ssh-copy-id` anyone?).
|
87
94
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
passwords to `rsync`: the only way is to install a tool called [`sshpass`](http://sourceforge.net/projects/sshpass/)
|
92
|
-
on your machine (and on the gateway machine, if you also need to specify the password
|
95
|
+
There's no easy way to pass SSH passwords to `rsync`: the only way is to install
|
96
|
+
a tool called [`sshpass`](http://sourceforge.net/projects/sshpass/) on your
|
97
|
+
machine (and on the gateway machine, if you also need to specify the password
|
93
98
|
of the final machine).
|
94
99
|
|
95
100
|
On Linux, you can install it with your standard package manager. On Mac, you can
|
data/lib/photocopier/ssh.rb
CHANGED
data/lib/photocopier/version.rb
CHANGED