OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / ncftp / original / man1 / ncftpput.1
1 .TH ncftpput 1 NcFTP Software
2 .SH NAME
3 ncftpput - Internet file transfer program for scripts
4 .SH "SYNOPSIS"
5 .PP
6 .B ncftpput
7 .RI [ "options" ]
8 .I "remote-host" "remote-directory" "local-files..."
9 .PP
10 .B ncftpput
11 -f
12 .I "login.cfg"
13 .RI [ "options" ]
14 .I "remote-directory" "local-files..."
15 .PP
16 .B ncftpput
17 -c
18 .I "remote-host" "remote-path-name"
19 <
20 .I "stdin"
21 .\"-------
22 .SH "OPTIONS"
23 .\"-------
24 .SS
25 Command line flags:
26 .TP 8
27 .BI "-u " "XX"
28 Use username
29 .I XX
30 instead of anonymous.
31 .TP 8
32 .BI "-p " "XX"
33 Use password
34 .I XX
35 with the username.
36 .TP 8
37 .BI "-P " "XX"
38 Use port number
39 .I XX
40 instead of the default FTP service port (21).
41 .TP 8
42 .BI "-j " "XX"
43 Use account
44 .I XX
45 in supplement to the username and password (deprecated).
46 .TP 8
47 .BI "-d " "XX"
48 Use the file
49 .I XX
50 for debug logging.
51 .TP 8
52 .B -a
53 Use ASCII transfer type instead of binary.
54 .TP 8
55 .B -m
56 Attempt to make the remote destination directory
57 before copying.
58 .TP 8
59 .BI "-t " "XX"
60 Timeout after
61 .I XX
62 seconds.
63 .TP 8
64 .BI "-U " "XX"
65 Use value
66 .I XX
67 for the umask.
68 .TP 8
69 .BR "-v" "/" "-V"
70 Do (do not) use progress meters.
71 The default is to use progress meters if the output stream is a TTY.
72 .TP 8
73 .BI "-f " "XX"
74 Read the file
75 .I XX
76 for host, user, and password information.
77 .TP 8
78 .B -A
79 Append to remote files, instead of overwriting them.
80 .TP 8
81 .BI "-T " "XX"
82 Upload into temporary files prefixed by
83 .IR "XX" "."
84 .TP 8
85 .BI "-S " "XX"
86 Upload into temporary files suffixed by
87 .IR "XX" "."
88 .TP 8
89 .B -R
90 Recursive mode; copy whole directory trees.
91 .TP 8
92 .BI "-r " "XX"
93 Redial a maximum of 
94 .I XX
95 times until connected to the remote FTP server.
96 .TP 8
97 .BR "-z" "/" "-Z"
98 Do (do not) try to resume transfers.
99 The default is to
100 .I not
101 try to resume (\-Z).
102 .TP 8
103 .B -E
104 Use regular (PORT) data connections.
105 .TP 8
106 .B -F
107 Use passive (PASV) data connections.
108 The default is to use passive, but to fallback to
109 regular if the passive connection fails or times out.
110 .TP 8
111 .B -DD
112 Delete local file after successfully uploading it.
113 .TP 8
114 .B -y
115 Try using "SITE UTIME" to preserve timestamps on remote host.
116 Not many remote FTP servers support this, so it may not work.
117 .TP 8
118 .B -b
119 Run in background (by submitting a job to
120 .IR ncftpbatch ")."
121 .TP 8
122 .BI "-B " "XX"
123 Try setting the TCP/IP socket buffer size to
124 .I XX
125 bytes.
126 .\"-------
127 .SH "DESCRIPTION"
128 .\"-------
129 .PP
130 The
131 purpose of
132 .I ncftpput
133 is to do file transfers from the command-line
134 without entering an interactive shell.
135 This lets you write shell scripts or other unattended
136 processes that can do FTP.
137 It is also useful for advanced users who
138 want to send files from the shell command line without
139 entering an interactive FTP program such as
140 .IR ncftp "."
141 .PP
142 By default the program tries to open the remote host
143 and login anonymously, but you can specify a username
144 and password information.
145 The
146 .B -u
147 option is used to specify the username to login as,
148 and the
149 .B -p
150 option is used to specify the password.
151 If you are running the program from the shell, you may
152 omit the
153 .B -p
154 option and the program will prompt you for the password.
155 .PP
156 Using the 
157 .B -u
158 and
159 .B -p
160 options are not recommended, because your account information
161 is exposed to anyone who can see your shell script or your
162 process information.  For example, someone using the
163 .I ps
164 program could see your password while the program runs.
165 .PP
166 You may use the
167 .B -f
168 option instead to specify a file with the account information.
169 However, this is still not secure because anyone who
170 has read access to the information file can see the
171 account information.
172 Nevertheless, if you choose to use the
173 .B -f
174 option the file should look something like this:
175 .RS
176 .sp
177 host sphygmomanometer.ncftp.com
178 .br
179 user gleason
180 .br
181 pass mypassword
182 .br
183 .sp
184 .RE
185 Don't forget to change the permissions on this file
186 so no one else can read them.
187 .PP
188 The
189 .B -d
190 option is very useful when you are trying to diagnose
191 why a file transfer is failing.
192 It prints out the
193 entire FTP conversation to the file you specify, so
194 you can get an idea of what went wrong.  
195 If you specify the special name
196 .I stdout
197 as the name of the debugging output file, the output
198 will instead print to the screen.
199 .PP
200 Using ASCII mode is helpful when the text format of your host
201 differs from that of the remote host.
202 For example, if you are sending a text file from
203 a UNIX system to a Windows-based host, you could use the
204 .B -a
205 flag which would use ASCII transfer mode so that the file
206 created on the Windows machine would be in its native text
207 format instead of the UNIX text format.
208 .PP
209 You can upload an entire directory tree of files by
210 using the
211 .B -R
212 flag.
213 Example:
214 .RS 4
215 .sp
216 $ ncftpput -R pikachu.nintendo.co.jp /incoming /tmp/stuff
217 .br
218 .sp
219 .RE
220 This would create a /incoming/stuff hierarchy on
221 the remote host.
222 .PP
223 The
224 .B -T
225 and
226 .B -S
227 options are useful when you want to upload file
228 to the remote host, but you don't want to use
229 the destination pathname until the file is
230 complete.
231 Using these options, you will not destroy a
232 remote file by the same name until your file
233 is finished.
234 These options are also useful when a remote
235 process on the remote host polls a specific
236 filename, and you don't want that process to
237 see that file until you know the file is
238 finished sending.
239 Here is an example that uploads to the file
240 /pub/incoming/README, using the filename
241 /pub/incoming/README.tmp as a temporary
242 filename:
243 .RS 4
244 .sp
245 $ ncftpput -S \.tmp bowser\.nintendo\.co\.jp /pub/incoming /a/README
246 .RE
247 .PP
248 A neat way to pipe the output from any local command into
249 a remote file is to use the
250 .B -c
251 option, which denotes that you're using
252 .I stdin
253 as input.
254 The following example shows how to make a backup and store
255 it on a remote machine:
256 .RS 4
257 .sp
258 $ tar cf / | ncftpput -c sonic\.sega\.co\.jp /usr/local/backup.tar
259 .RE
260 .\"-------
261 .SH "DIAGNOSTICS"
262 .\"-------
263 .PP
264 .I ncftpput
265 returns the following exit values:
266 .TP 8
267 0
268 Success.
269 .TP 8
270 1
271 Could not connect to remote host.
272 .TP 8
273 2
274 Could not connect to remote host - timed out.
275 .TP 8
276 3
277 Transfer failed.
278 .TP 8
279 4
280 Transfer failed - timed out.
281 .TP 8
282 5
283 Directory change failed.
284 .TP 8
285 6
286 Directory change failed - timed out.
287 .TP 8
288 7
289 Malformed URL.
290 .TP 8
291 8
292 Usage error.
293 .TP 8
294 9
295 Error in login configuration file.
296 .TP 8
297 10
298 Library initialization failed.
299 .TP 8
300 11
301 Session initialization failed.
302 .\"-------
303 .SH "AUTHOR"
304 .\"-------
305 .PP
306 Mike Gleason, NcFTP Software (mgleason@ncftp.com).
307 .\"-------
308 .SH "SEE ALSO"
309 .\"-------
310 .PP
311 .IR ncftpget (1),
312 .IR ncftp (1),
313 .IR ftp (1),
314 .IR rcp (1),
315 .IR tftp (1).
316 .PP
317 .IR "LibNcFTP" " (http://www.ncftp.com/libncftp/)."