Debian Codegraph @

doc/html/ncftpput.html

raw
1 <HTML>
2 <HEAD>
3 <TITLE>ncftpput(1) manual page</TITLE>
4 </HEAD>
5 <BODY bgcolor=white>
6
7 <H2>Name</H2>
8 <blockquote>
9 <b>
10 ncftpput</b> - Internet file transfer program for scripts
11 </blockquote>
12 <H2>Synopsis</H2>
13 <blockquote>
14 <P>
15 <B>ncftpput</B>
16 [<I>options</I>]<I></I> <I>remote-host remote-directory local-files...</I>
17 <P>
18 <B>ncftpput</B>
19 [<I>options</I>]<I></I> <I>bookmark-name remote-directory local-files...</I>
20 <P>
21 <B>ncftpput</B> <tt>-f</tt> <I>login.cfg</I>
22 [<I>options</I>] <I>remote-directory local-files...</I>
23 <P>
24 <B>ncftpput</B> <tt>-c</tt> <I>remote-host remote-path-name</I> <tt>&lt; stdin</tt>
25 <P>
26 <B>ncftpput</B> <tt>-C</tt> <I>remote-host local-path-name remote-path-name</I>
27 </blockquote>
28
29 <center>
30 <p>
31 <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
32 <input type="hidden" name="cmd" value="_s-xclick">
33 <input type="hidden" name="hosted_button_id" value="5JS76LUNSD3HU">
34 <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
35 <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
36 </form>
37 </center>
38
39 <H2>Options</H2>
40 Command line flags:
41 <blockquote>
42 <DL>
43
44 <DT><B>-u </B><I>XX</I> </DT>
45 <DD>Use username <I>XX</I> instead of anonymous.
46 </DD>
47
48 <DT><B>-p </B><I>XX</I> </DT>
49 <DD>Use password <I>XX</I> with the username. </DD>
50
51 <DT><B>-P </B><I>XX</I> </DT>
52 <DD>Use port number <I>XX</I> instead
53 of the default FTP service port (21). </DD>
54
55 <DT><B>-j </B><I>XX</I> </DT>
56 <DD>Use account <I>XX</I> in supplement
57 to the username and password (deprecated). </DD>
58
59 <DT><B>-d </B><I>XX</I> </DT>
60 <DD>Use the file <I>XX</I> for debug
61 logging. </DD>
62
63 <DT><B>-a</B> </DT>
64 <DD>Use ASCII transfer type instead of binary. </DD>
65
66 <DT><B>-m</B> </DT>
67 <DD>Attempt to make the
68 remote destination directory before copying. </DD>
69
70 <DT><B>-t </B><I>XX</I> </DT>
71 <DD>Timeout after <I>XX</I> seconds.
72 </DD>
73
74 <DT><B>-U </B><I>XX</I> </DT>
75 <DD>Use value <I>XX</I> for the umask. </DD>
76
77 <DT><B>-v</B>/<B>-V</B> </DT>
78 <DD>Do (do not) use progress meters. The
79 default is to use progress meters if the output stream is a TTY. </DD>
80
81 <DT><B>-f </B><I>XX</I> </DT>
82 <DD>Read
83 the file <I>XX</I> for host, user, and password information. </DD>
84
85 <DT><B>-c</B> </DT>
86 <DD>Read locally from standard input and write remotely to specified pathname.</DD>
87
88 <DT><B>-C</B> </DT>
89 <DD>Similar to <b>-c</b>, except a local pathname is specified rather than reading from standard input.</DD>
90
91 <DT><B>-A</B> </DT>
92 <DD>Append to remote
93 files, instead of overwriting them. </DD>
94
95 <DT><B>-T </B><I>XX</I> </DT>
96 <DD>Upload into temporary files prefixed
97 by <I>XX</I>. </DD>
98
99 <DT><B>-S </B><I>XX</I> </DT>
100 <DD>Upload into temporary files suffixed by <I>XX</I>. </DD>
101
102 <DT><B>-R</B> </DT>
103 <DD>Recursive mode;
104 copy whole directory trees. </DD>
105
106 <DT><B>-r </B><I>XX</I> </DT>
107 <DD>Redial a maximum of <I>XX</I> times until connected
108 to the remote FTP server. </DD>
109
110 <DT><B>-z</B>/<B>-Z</B> </DT>
111 <DD>Do (do not) try to resume transfers. The default
112 is to <I>not</I> try to resume (-Z). </DD>
113
114 <DT><B>-E</B> </DT>
115 <DD>Use regular (PORT) data connections. </DD>
116
117 <DT><B>-F</B> </DT>
118 <DD>Use passive (PASV) data connections.&nbsp; The default is to use passive, but to fallback to
119 regular if the passive connection fails or times out. </DD>
120
121 <DT><B>-DD</B> </DT>
122 <DD>Delete
123 local file after successfully uploading it. </DD>
124
125 <DT><B>-y</B> </DT>
126 <DD>Try using "SITE UTIME" to
127 preserve timestamps on remote host. Not many remote FTP servers support
128 this, so it may not work. </DD>
129
130 <DT><B>-b</B> </DT>
131 <DD>Run in background (by submitting a job to <I>ncftpbatch</I>).
132 </DD>
133
134 <DT><B>-bb</B> </DT>
135 <DD>
136 Similar to <b>-b</b> option, but only submits the batch
137 job. You will need to run <i>ncftpbatch</i> for the
138 batch job to be processed. This is useful if you
139 already have a <i>ncftpbatch</i> process running, or wish
140 to have better control of when batch jobs are processed.
141 <P>
142 For example, if you wanted to do background processing
143 of three files all on the same remote
144 server, it is more polite to use just one <i>ncftpbatch</i>
145 process to process the three jobs sequentially,
146 rather than having three <i>ncftpbatch</i> processes open
147 three simultaneous FTP sessions to the same server.
148 </DD>
149
150 <DT><B>-B </B><I>XX</I> </DT>
151 <DD>Try setting the TCP/IP socket buffer size to <I>XX</I> bytes. </DD>
152 </DL>
153
154 <DT><B>-W </B><I>XX</I> </DT>
155 <DD>Send raw FTP command <I>XX</I> after logging in.</DD>
156
157 <DT><B>-X </B><I>XX</I> </DT>
158 <DD>Send raw FTP command <I>XX</I> after each file transferred.</DD>
159
160 <DT><B>-Y </B><I>XX</I> </DT>
161 <DD>
162 Send raw FTP command <I>XX</I> before logging out.
163 <P>
164 The <B>-W</B>, <B>-X</B>, and <B>-Y</B> options are useful for advanced
165 users who need to tweak behavior on some servers.
166 For example, users accessing mainframes might need
167 to send some special SITE commands to set blocksize
168 and record format information.
169 <P>
170 For these options, you can use them multiple times
171 each if you need to send multiple commands.
172 For the
173 <B>-X</B> option, you can use the cookie <TT>%s</TT> to expand
174 into the name of the file that was transferred.
175 </DD>
176
177 <DT><B>-o </B><I>XX</I> </DT>
178 <DD>Set advanced option <I>XX</I>.
179 <P>
180 This option is used primarily for debugging.
181 It sets the value of an internal variable to an integer value.
182 An example usage would be:
183 <tt>-o useFEAT=0,useCLNT=1</tt>
184 which in this case, disables use of the
185 FEAT command and enables use of the CLNT command.
186 The available variables include:
187 <tt>usePASV</tt>,
188 <tt>useSIZE</tt>,
189 <tt>useMDTM</tt>,
190 <tt>useREST</tt>,
191 <tt>useNLST_a</tt>,
192 <tt>useNLST_d</tt>,
193 <tt>useFEAT</tt>,
194 <tt>useMLSD</tt>,
195 <tt>useMLST</tt>,
196 <tt>useCLNT</tt>,
197 <tt>useHELP_SITE</tt>,
198 <tt>useSITE_UTIME</tt>,
199 <tt>STATfileParamWorks</tt>,
200 <tt>NLSTfileParamWorks</tt>,
201 <tt>require20</tt>,
202 <tt>allowProxyForPORT</tt>,
203 <tt>doNotGetStartCWD</tt>.
204 </DD>
205
206 </blockquote>
207
208 <H2>Description</H2>
209
210 <P>
211 The purpose of <I>ncftpput</I> is to do file transfers from the command-line without
212 entering an interactive shell. This lets you write shell scripts or other
213 unattended processes that can do FTP. It is also useful for advanced users
214 who want to send files from the shell command line without entering an
215 interactive FTP program such as <I>ncftp</I>. <P>
216 By default the program tries to open
217 the remote host and login anonymously, but you can specify a username and
218 password information. The <B>-u</B> option is used to specify the username to login
219 as, and the <B>-p</B> option is used to specify the password. If you are running
220 the program from the shell, you may omit the <B>-p</B> option and the program will
221 prompt you for the password. <P>
222 Using the <B>-u</B> and <B>-p</B> options are not recommended,
223 because your account information is exposed to anyone who can see your
224 shell script or your process information. For example, someone using the
225 <I>ps</I> program could see your password while the program runs. <P>
226 You may use the
227 <B>-f</B> option instead to specify a file with the account information. However,
228 this is still not secure because anyone who has read access to the information
229 file can see the account information. Nevertheless, if you choose to use
230 the <B>-f</B> option the file should look something like this: <blockquote><pre>host sphygmomanometer.ncftp.com
231 user gleason
232 pass mypasswd</pre>
233 </blockquote>
234 Don't forget to change the permissions on this file so no one else can read
235 them. <P>
236 The <B>-d</B> option is very useful when you are trying to diagnose why a
237 file transfer is failing. It prints out the entire FTP conversation to the
238 file you specify, so you can get an idea of what went wrong. If you specify
239 the special name <I>stdout</I> as the name of the debugging output file, the output
240 will instead print to the screen. <P>
241 Using ASCII mode is helpful when the text
242 format of your host differs from that of the remote host. For example, if
243 you are sending a text file from a UNIX system to a Windows-based host,
244 you could use the <B>-a</B> flag which would use ASCII transfer mode so that the
245 file created on the Windows machine would be in its native text format
246 instead of the UNIX text format. <P>
247 You can upload an entire directory tree
248 of files by using the <B>-R</B> flag. Example: <blockquote><pre>$ ncftpput -R pikachu.nintendo.co.jp /incoming /tmp/stuff</pre>
249 </blockquote>
250 This would create a /incoming/stuff hierarchy on the remote host. <P>
251 The <B>-T</B>
252 and <B>-S</B> options are useful when you want to upload file to the remote host,
253 but you don't want to use the destination pathname until the file is complete.
254 Using these options, you will not destroy a remote file by the same name
255 until your file is finished. These options are also useful when a remote
256 process on the remote host polls a specific filename, and you don't want
257 that process to see that file until you know the file is finished sending.
258 Here is an example that uploads to the file /pub/incoming/README, using
259 the filename /pub/incoming/README.tmp as a temporary filename: <blockquote><pre>$ ncftpput -S .tmp bowser.nintendo.co.jp /pub/incoming /a/README</pre>
260 </blockquote>
261 <P>
262 A neat way to pipe the output
263 from any local command into a remote file is to use the <B>-c</B> option, which
264 denotes that you're using <I>stdin</I> as input. The following example shows how
265 to make a backup and store it on a remote machine: <blockquote><pre>$ tar cf - / | ncftpput -c sonic.sega.co.jp /usr/local/backup.tar</pre>
266 </blockquote>
267
268 <H2>Diagnostics</H2>
269 <blockquote>
270 <P>
271 <I>ncftpput</I> returns the following
272 exit values:
273 <OL start="0">
274 <LI>Success. </LI><LI>Could not connect to remote host. </LI><LI>Could not connect
275 to remote host - timed out. </LI><LI>Transfer failed. </LI><LI>Transfer failed - timed out. </LI><LI>Directory
276 change failed. </LI><LI>Directory change failed - timed out. </LI><LI>Malformed URL. </LI><LI>Usage error.
277 </LI><LI>Error in login configuration file. </LI><LI>Library initialization failed. </LI><LI>Session
278 initialization failed. </LI>
279 </OL>
280
281 </blockquote>
282
283 <H2>Author</H2>
284 <blockquote>
285 <P>
286 Mike Gleason, <a href="http://www.ncftp.com">NcFTP Software</a>.
287 </blockquote>
288 <H2>See Also</H2>
289 <blockquote>
290 <P>
291 <I>ncftpput(1)</I>, <I>ncftpget(1),</I>
292 <I>ncftp(1)</I>, <I>ftp(1)</I>, <I>rcp(1)</I>, <I>tftp(1)</I>. <P>
293 <I>LibNcFTP</I> (<a href="http://www.ncftp.com/libncftp/">http://www.ncftp.com/libncftp/</a>).
294 </blockquote>
295 </BODY></HTML>