version 1, including all changes.
.
Rev |
Author |
# |
Line |
1 |
perry |
1 |
ncftpput |
|
|
2 |
!!!ncftpput |
|
|
3 |
NAME |
|
|
4 |
SYNOPSIS |
|
|
5 |
OPTIONS |
|
|
6 |
DESCRIPTION |
|
|
7 |
DIAGNOSTICS |
|
|
8 |
AUTHOR |
|
|
9 |
SEE ALSO |
|
|
10 |
---- |
|
|
11 |
!!NAME |
|
|
12 |
|
|
|
13 |
|
|
|
14 |
ncftpput - Internet file transfer program for scripts |
|
|
15 |
!!SYNOPSIS |
|
|
16 |
|
|
|
17 |
|
|
|
18 |
__ncftpput__ [[''options''] ''remote-host |
|
|
19 |
remote-directory local-files...'' |
|
|
20 |
|
|
|
21 |
|
|
|
22 |
__ncftpput__ -f ''login.cfg'' [[''options''] |
|
|
23 |
''remote-directory local-files...'' |
|
|
24 |
|
|
|
25 |
|
|
|
26 |
__ncftpput__ -c ''remote-host remote-path-name'' |
|
|
27 |
''stdin'' |
|
|
28 |
!!OPTIONS |
|
|
29 |
|
|
|
30 |
|
|
|
31 |
__Command line flags:__ |
|
|
32 |
|
|
|
33 |
|
|
|
34 |
__-u__ ''XX'' |
|
|
35 |
|
|
|
36 |
|
|
|
37 |
Use username ''XX'' instead of anonymous. |
|
|
38 |
|
|
|
39 |
|
|
|
40 |
__-p__ ''XX'' |
|
|
41 |
|
|
|
42 |
|
|
|
43 |
Use password ''XX'' with the username. |
|
|
44 |
|
|
|
45 |
|
|
|
46 |
__-P__ ''XX'' |
|
|
47 |
|
|
|
48 |
|
|
|
49 |
Use port number ''XX'' instead of the default FTP service |
|
|
50 |
port (21). |
|
|
51 |
|
|
|
52 |
|
|
|
53 |
__-j__ ''XX'' |
|
|
54 |
|
|
|
55 |
|
|
|
56 |
Use account ''XX'' in supplement to the username and |
|
|
57 |
password (deprecated). |
|
|
58 |
|
|
|
59 |
|
|
|
60 |
__-d__ ''XX'' |
|
|
61 |
|
|
|
62 |
|
|
|
63 |
Use the file ''XX'' for debug logging. |
|
|
64 |
|
|
|
65 |
|
|
|
66 |
__-a__ |
|
|
67 |
|
|
|
68 |
|
|
|
69 |
Use ASCII transfer type instead of binary. |
|
|
70 |
|
|
|
71 |
|
|
|
72 |
__-m__ |
|
|
73 |
|
|
|
74 |
|
|
|
75 |
Attempt to make the remote destination directory before |
|
|
76 |
copying. |
|
|
77 |
|
|
|
78 |
|
|
|
79 |
__-t__ ''XX'' |
|
|
80 |
|
|
|
81 |
|
|
|
82 |
Timeout after ''XX'' seconds. |
|
|
83 |
|
|
|
84 |
|
|
|
85 |
__-U__ ''XX'' |
|
|
86 |
|
|
|
87 |
|
|
|
88 |
Use value ''XX'' for the umask. |
|
|
89 |
|
|
|
90 |
|
|
|
91 |
__-v__/__-V__ |
|
|
92 |
|
|
|
93 |
|
|
|
94 |
Do (do not) use progress meters. The default is to use |
|
|
95 |
progress meters if the output stream is a TTY. |
|
|
96 |
|
|
|
97 |
|
|
|
98 |
__-f__ ''XX'' |
|
|
99 |
|
|
|
100 |
|
|
|
101 |
Read the file ''XX'' for host, user, and password |
|
|
102 |
information. |
|
|
103 |
|
|
|
104 |
|
|
|
105 |
__-A__ |
|
|
106 |
|
|
|
107 |
|
|
|
108 |
Append to remote files, instead of overwriting |
|
|
109 |
them. |
|
|
110 |
|
|
|
111 |
|
|
|
112 |
__-T__ ''XX'' |
|
|
113 |
|
|
|
114 |
|
|
|
115 |
Upload into temporary files prefixed by |
|
|
116 |
''XX''. |
|
|
117 |
|
|
|
118 |
|
|
|
119 |
__-S__ ''XX'' |
|
|
120 |
|
|
|
121 |
|
|
|
122 |
Upload into temporary files suffixed by |
|
|
123 |
''XX''. |
|
|
124 |
|
|
|
125 |
|
|
|
126 |
__-R__ |
|
|
127 |
|
|
|
128 |
|
|
|
129 |
Recursive mode; copy whole directory trees. |
|
|
130 |
|
|
|
131 |
|
|
|
132 |
__-r__ ''XX'' |
|
|
133 |
|
|
|
134 |
|
|
|
135 |
Redial a maximum of ''XX'' times until connected to the |
|
|
136 |
remote FTP server. |
|
|
137 |
|
|
|
138 |
|
|
|
139 |
__-z__/__-Z__ |
|
|
140 |
|
|
|
141 |
|
|
|
142 |
Do (do not) try to resume transfers. The default is to |
|
|
143 |
''not'' try to resume (-Z). |
|
|
144 |
|
|
|
145 |
|
|
|
146 |
__-E__ |
|
|
147 |
|
|
|
148 |
|
|
|
149 |
Use regular (PORT) data connections. |
|
|
150 |
|
|
|
151 |
|
|
|
152 |
__-F__ |
|
|
153 |
|
|
|
154 |
|
|
|
155 |
Use passive (PASV) data connections. The default is to use |
|
|
156 |
passive, but to fallback to regular if the passive |
|
|
157 |
connection fails or times out. |
|
|
158 |
|
|
|
159 |
|
|
|
160 |
__-DD__ |
|
|
161 |
|
|
|
162 |
|
|
|
163 |
Delete local file after successfully uploading |
|
|
164 |
it. |
|
|
165 |
|
|
|
166 |
|
|
|
167 |
__-y__ |
|
|
168 |
|
|
|
169 |
|
|
|
170 |
Try using |
|
|
171 |
|
|
|
172 |
|
|
|
173 |
__-b__ |
|
|
174 |
|
|
|
175 |
|
|
|
176 |
Run in background (by submitting a batch job and then |
|
|
177 |
spawning ''ncftpbatch''). |
|
|
178 |
|
|
|
179 |
|
|
|
180 |
__-bb__ |
|
|
181 |
|
|
|
182 |
|
|
|
183 |
Similar to __-b__ option, but only submits the batch job. |
|
|
184 |
You will need to run ''ncftpbatch'' for the batch job to |
|
|
185 |
be processed. This is useful if you already have a |
|
|
186 |
''ncftpbatch'' process running, or wish to have better |
|
|
187 |
control of when batch jobs are processed. |
|
|
188 |
|
|
|
189 |
|
|
|
190 |
For example, if you wanted to do background processing of |
|
|
191 |
three files all on the same remote server, it is more polite |
|
|
192 |
to use just one ''ncftpbatch'' process to process the |
|
|
193 |
three jobs sequentially, rather than having three |
|
|
194 |
''ncftpbatch'' processes open three simultaneous FTP |
|
|
195 |
sessions to the same server. |
|
|
196 |
|
|
|
197 |
|
|
|
198 |
__-B__ ''XX'' |
|
|
199 |
|
|
|
200 |
|
|
|
201 |
Try setting the TCP/IP socket buffer size to ''XX'' |
|
|
202 |
bytes. |
|
|
203 |
|
|
|
204 |
|
|
|
205 |
__-W__ ''XX'' |
|
|
206 |
|
|
|
207 |
|
|
|
208 |
Send raw FTP command ''XX'' after logging |
|
|
209 |
in. |
|
|
210 |
|
|
|
211 |
|
|
|
212 |
__-X__ ''XX'' |
|
|
213 |
|
|
|
214 |
|
|
|
215 |
Send raw FTP command ''XX'' after each file |
|
|
216 |
transferred. |
|
|
217 |
|
|
|
218 |
|
|
|
219 |
__-Y__ ''XX'' |
|
|
220 |
|
|
|
221 |
|
|
|
222 |
Send raw FTP command ''XX'' before logging |
|
|
223 |
out. |
|
|
224 |
|
|
|
225 |
|
|
|
226 |
The __-W__, __-X__, and __-Y__ options are useful |
|
|
227 |
for advanced users who need to tweak behavior on some |
|
|
228 |
servers. For example, users accessing mainframes might need |
|
|
229 |
to send some special SITE commands to set blocksize and |
|
|
230 |
record format information. |
|
|
231 |
|
|
|
232 |
|
|
|
233 |
For these options, you can use them multiple times each if |
|
|
234 |
you need to send multiple commands. For the __-X__ |
|
|
235 |
option, you can use the cookie __%s__ to expand into the |
|
|
236 |
name of the file that was transferred. |
|
|
237 |
!!DESCRIPTION |
|
|
238 |
|
|
|
239 |
|
|
|
240 |
The purpose of ''ncftpput'' is to do file transfers from |
|
|
241 |
the command-line without entering an interactive shell. This |
|
|
242 |
lets you write shell scripts or other unattended processes |
|
|
243 |
that can do FTP. It is also useful for advanced users who |
|
|
244 |
want to send files from the shell command line without |
|
|
245 |
entering an interactive FTP program such as |
|
|
246 |
''ncftp''. |
|
|
247 |
|
|
|
248 |
|
|
|
249 |
By default the program tries to open the remote host and |
|
|
250 |
login anonymously, but you can specify a username and |
|
|
251 |
password information. The __-u__ option is used to |
|
|
252 |
specify the username to login as, and the __-p__ option |
|
|
253 |
is used to specify the password. If you are running the |
|
|
254 |
program from the shell, you may omit the __-p__ option |
|
|
255 |
and the program will prompt you for the |
|
|
256 |
password. |
|
|
257 |
|
|
|
258 |
|
|
|
259 |
Using the __-u__ and __-p__ options are not |
|
|
260 |
recommended, because your account information is exposed to |
|
|
261 |
anyone who can see your shell script or your process |
|
|
262 |
information. For example, someone using the ''ps'' |
|
|
263 |
program could see your password while the program |
|
|
264 |
runs. |
|
|
265 |
|
|
|
266 |
|
|
|
267 |
You may use the __-f__ option instead to specify a file |
|
|
268 |
with the account information. However, this is still not |
|
|
269 |
secure because anyone who has read access to the information |
|
|
270 |
file can see the account information. Nevertheless, if you |
|
|
271 |
choose to use the __-f__ option the file should look |
|
|
272 |
something like this: |
|
|
273 |
|
|
|
274 |
|
|
|
275 |
host sphygmomanometer.ncftp.com |
|
|
276 |
user gleason |
|
|
277 |
pass mypassword |
|
|
278 |
|
|
|
279 |
|
|
|
280 |
Don't forget to change the permissions on this file so no |
|
|
281 |
one else can read them. |
|
|
282 |
|
|
|
283 |
|
|
|
284 |
The __-d__ option is very useful when you are trying to |
|
|
285 |
diagnose why a file transfer is failing. It prints out the |
|
|
286 |
entire FTP conversation to the file you specify, so you can |
|
|
287 |
get an idea of what went wrong. If you specify the special |
|
|
288 |
name ''stdout'' as the name of the debugging output file, |
|
|
289 |
the output will instead print to the screen. |
|
|
290 |
|
|
|
291 |
|
|
|
292 |
Using ASCII mode is helpful when the text format of your |
|
|
293 |
host differs from that of the remote host. For example, if |
|
|
294 |
you are sending a text file from a UNIX system to a |
|
|
295 |
Windows-based host, you could use the __-a__ flag which |
|
|
296 |
would use ASCII transfer mode so that the file created on |
|
|
297 |
the Windows machine would be in its native text format |
|
|
298 |
instead of the UNIX text format. |
|
|
299 |
|
|
|
300 |
|
|
|
301 |
You can upload an entire directory tree of files by using |
|
|
302 |
the __-R__ flag. Example: |
|
|
303 |
|
|
|
304 |
|
|
|
305 |
$ ncftpput -R pikachu.nintendo.co.jp /incoming |
|
|
306 |
/tmp/stuff |
|
|
307 |
|
|
|
308 |
|
|
|
309 |
This would create a /incoming/stuff hierarchy on the remote |
|
|
310 |
host. |
|
|
311 |
|
|
|
312 |
|
|
|
313 |
The __-T__ and __-S__ options are useful when you want |
|
|
314 |
to upload file to the remote host, but you don't want to use |
|
|
315 |
the destination pathname until the file is complete. Using |
|
|
316 |
these options, you will not destroy a remote file by the |
|
|
317 |
same name until your file is finished. These options are |
|
|
318 |
also useful when a remote process on the remote host polls a |
|
|
319 |
specific filename, and you don't want that process to see |
|
|
320 |
that file until you know the file is finished sending. Here |
|
|
321 |
is an example that uploads to the file /pub/incoming/README, |
|
|
322 |
using the filename /pub/incoming/README.tmp as a temporary |
|
|
323 |
filename: |
|
|
324 |
|
|
|
325 |
|
|
|
326 |
$ ncftpput -S .tmp bowser.nintendo.co.jp /pub/incoming |
|
|
327 |
/a/README |
|
|
328 |
|
|
|
329 |
|
|
|
330 |
A neat way to pipe the output from any local command into a |
|
|
331 |
remote file is to use the __-c__ option, which denotes |
|
|
332 |
that you're using ''stdin'' as input. The following |
|
|
333 |
example shows how to make a backup and store it on a remote |
|
|
334 |
machine: |
|
|
335 |
|
|
|
336 |
|
|
|
337 |
$ tar cf - / | ncftpput -c sonic.sega.co.jp |
|
|
338 |
/usr/local/backup.tar |
|
|
339 |
!!DIAGNOSTICS |
|
|
340 |
|
|
|
341 |
|
|
|
342 |
''ncftpput'' returns the following exit |
|
|
343 |
values: |
|
|
344 |
|
|
|
345 |
|
|
|
346 |
0 |
|
|
347 |
|
|
|
348 |
|
|
|
349 |
Success. |
|
|
350 |
|
|
|
351 |
|
|
|
352 |
1 |
|
|
353 |
|
|
|
354 |
|
|
|
355 |
Could not connect to remote host. |
|
|
356 |
|
|
|
357 |
|
|
|
358 |
2 |
|
|
359 |
|
|
|
360 |
|
|
|
361 |
Could not connect to remote host - timed out. |
|
|
362 |
|
|
|
363 |
|
|
|
364 |
3 |
|
|
365 |
|
|
|
366 |
|
|
|
367 |
Transfer failed. |
|
|
368 |
|
|
|
369 |
|
|
|
370 |
4 |
|
|
371 |
|
|
|
372 |
|
|
|
373 |
Transfer failed - timed out. |
|
|
374 |
|
|
|
375 |
|
|
|
376 |
5 |
|
|
377 |
|
|
|
378 |
|
|
|
379 |
Directory change failed. |
|
|
380 |
|
|
|
381 |
|
|
|
382 |
6 |
|
|
383 |
|
|
|
384 |
|
|
|
385 |
Directory change failed - timed out. |
|
|
386 |
|
|
|
387 |
|
|
|
388 |
7 |
|
|
389 |
|
|
|
390 |
|
|
|
391 |
Malformed URL. |
|
|
392 |
|
|
|
393 |
|
|
|
394 |
8 |
|
|
395 |
|
|
|
396 |
|
|
|
397 |
Usage error. |
|
|
398 |
|
|
|
399 |
|
|
|
400 |
9 |
|
|
401 |
|
|
|
402 |
|
|
|
403 |
Error in login configuration file. |
|
|
404 |
|
|
|
405 |
|
|
|
406 |
10 |
|
|
407 |
|
|
|
408 |
|
|
|
409 |
Library initialization failed. |
|
|
410 |
|
|
|
411 |
|
|
|
412 |
11 |
|
|
413 |
|
|
|
414 |
|
|
|
415 |
Session initialization failed. |
|
|
416 |
!!AUTHOR |
|
|
417 |
|
|
|
418 |
|
|
|
419 |
Mike Gleason, NcFTP Software |
|
|
420 |
(mgleason@ncftp.com). |
|
|
421 |
!!SEE ALSO |
|
|
422 |
|
|
|
423 |
|
|
|
424 |
ncftpget(1), ncftp(1), ftp(1), |
|
|
425 |
rcp(1), tftp(1). |
|
|
426 |
|
|
|
427 |
|
|
|
428 |
''LibNcFTP'' |
|
|
429 |
(http://www.ncftp.com/libncftp/). |
|
|
430 |
---- |