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