xref: /freebsd/usr.bin/fetch/fetch.1 (revision 2821a7498f65d357c68166e1978b491abef1ca4a)
1b39628e7SDag-Erling Smørgrav.\"-
2c2ea176dSDag-Erling Smørgrav.\" Copyright (c) 2000-2014 Dag-Erling Smørgrav
31ec923fdSMichael Gmelin.\" Copyright (c) 2013-2016 Michael Gmelin <freebsd@grem.de>
4b39628e7SDag-Erling Smørgrav.\" All rights reserved.
5114c3c1aSDag-Erling Smørgrav.\" Portions Copyright (c) 1999 Massachusetts Institute of Technology; used
6114c3c1aSDag-Erling Smørgrav.\" by permission.
7b39628e7SDag-Erling Smørgrav.\"
8b39628e7SDag-Erling Smørgrav.\" Redistribution and use in source and binary forms, with or without
9b39628e7SDag-Erling Smørgrav.\" modification, are permitted provided that the following conditions
10b39628e7SDag-Erling Smørgrav.\" are met:
11b39628e7SDag-Erling Smørgrav.\" 1. Redistributions of source code must retain the above copyright
12b39628e7SDag-Erling Smørgrav.\"    notice, this list of conditions and the following disclaimer
13b39628e7SDag-Erling Smørgrav.\"    in this position and unchanged.
14b39628e7SDag-Erling Smørgrav.\" 2. Redistributions in binary form must reproduce the above copyright
15b39628e7SDag-Erling Smørgrav.\"    notice, this list of conditions and the following disclaimer in the
16b39628e7SDag-Erling Smørgrav.\"    documentation and/or other materials provided with the distribution.
17b39628e7SDag-Erling Smørgrav.\" 3. The name of the author may not be used to endorse or promote products
18b39628e7SDag-Erling Smørgrav.\"    derived from this software without specific prior written permission.
19b39628e7SDag-Erling Smørgrav.\"
20b39628e7SDag-Erling Smørgrav.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21b39628e7SDag-Erling Smørgrav.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
22b39628e7SDag-Erling Smørgrav.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23b39628e7SDag-Erling Smørgrav.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24b39628e7SDag-Erling Smørgrav.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25b39628e7SDag-Erling Smørgrav.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26b39628e7SDag-Erling Smørgrav.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27b39628e7SDag-Erling Smørgrav.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28b39628e7SDag-Erling Smørgrav.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29b39628e7SDag-Erling Smørgrav.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30b39628e7SDag-Erling Smørgrav.\"
31*2821a749SDag-Erling Smørgrav.Dd October 7, 2023
327fefc698SJordan K. Hubbard.Dt FETCH 1
33b39628e7SDag-Erling Smørgrav.Os
347fefc698SJordan K. Hubbard.Sh NAME
357fefc698SJordan K. Hubbard.Nm fetch
367fefc698SJordan K. Hubbard.Nd retrieve a file by Uniform Resource Locator
377fefc698SJordan K. Hubbard.Sh SYNOPSIS
38b39628e7SDag-Erling Smørgrav.Nm
39e801aa48SRuslan Ermilov.Op Fl 146AadFlMmnPpqRrsUv
40b39628e7SDag-Erling Smørgrav.Op Fl B Ar bytes
41dcd47379SDag-Erling Smørgrav.Op Fl -bind-address= Ns Ar host
42dcd47379SDag-Erling Smørgrav.Op Fl -ca-cert= Ns Ar file
43dcd47379SDag-Erling Smørgrav.Op Fl -ca-path= Ns Ar dir
44dcd47379SDag-Erling Smørgrav.Op Fl -cert= Ns Ar file
45dcd47379SDag-Erling Smørgrav.Op Fl -crl= Ns Ar file
467f92799fSMurray Stokely.Op Fl i Ar file
47dcd47379SDag-Erling Smørgrav.Op Fl -key= Ns Ar file
487dcb0a0eSDag-Erling Smørgrav.Op Fl N Ar file
49dcd47379SDag-Erling Smørgrav.Op Fl -no-passive
50dcd47379SDag-Erling Smørgrav.Op Fl -no-proxy= Ns Ar list
51dcd47379SDag-Erling Smørgrav.Op Fl -no-sslv3
52dcd47379SDag-Erling Smørgrav.Op Fl -no-tlsv1
53dcd47379SDag-Erling Smørgrav.Op Fl -no-verify-hostname
54dcd47379SDag-Erling Smørgrav.Op Fl -no-verify-peer
557fefc698SJordan K. Hubbard.Op Fl o Ar file
56dcd47379SDag-Erling Smørgrav.Op Fl -referer= Ns Ar URL
57e801aa48SRuslan Ermilov.Op Fl S Ar bytes
58e801aa48SRuslan Ermilov.Op Fl T Ar seconds
59dcd47379SDag-Erling Smørgrav.Op Fl -user-agent= Ns Ar agent-string
60b39628e7SDag-Erling Smørgrav.Op Fl w Ar seconds
61e801aa48SRuslan Ermilov.Ar URL ...
62e801aa48SRuslan Ermilov.Nm
63e801aa48SRuslan Ermilov.Op Fl 146AadFlMmnPpqRrsUv
64e801aa48SRuslan Ermilov.Op Fl B Ar bytes
65dcd47379SDag-Erling Smørgrav.Op Fl -bind-address= Ns Ar host
66dcd47379SDag-Erling Smørgrav.Op Fl -ca-cert= Ns Ar file
67dcd47379SDag-Erling Smørgrav.Op Fl -ca-path= Ns Ar dir
68dcd47379SDag-Erling Smørgrav.Op Fl -cert= Ns Ar file
69dcd47379SDag-Erling Smørgrav.Op Fl -crl= Ns Ar file
707f92799fSMurray Stokely.Op Fl i Ar file
71dcd47379SDag-Erling Smørgrav.Op Fl -key= Ns Ar file
72e801aa48SRuslan Ermilov.Op Fl N Ar file
73dcd47379SDag-Erling Smørgrav.Op Fl -no-passive
74dcd47379SDag-Erling Smørgrav.Op Fl -no-proxy= Ns Ar list
75dcd47379SDag-Erling Smørgrav.Op Fl -no-sslv3
76dcd47379SDag-Erling Smørgrav.Op Fl -no-tlsv1
77dcd47379SDag-Erling Smørgrav.Op Fl -no-verify-hostname
78dcd47379SDag-Erling Smørgrav.Op Fl -no-verify-peer
79e801aa48SRuslan Ermilov.Op Fl o Ar file
80dcd47379SDag-Erling Smørgrav.Op Fl -referer= Ns Ar URL
81e801aa48SRuslan Ermilov.Op Fl S Ar bytes
82e801aa48SRuslan Ermilov.Op Fl T Ar seconds
83dcd47379SDag-Erling Smørgrav.Op Fl -user-agent= Ns Ar agent-string
84e801aa48SRuslan Ermilov.Op Fl w Ar seconds
85e801aa48SRuslan Ermilov.Fl h Ar host Fl f Ar file Oo Fl c Ar dir Oc
867fefc698SJordan K. Hubbard.Sh DESCRIPTION
873898680cSPhilippe CharnierThe
883898680cSPhilippe Charnier.Nm
893898680cSPhilippe Charnierutility provides a command-line interface to the
90b39628e7SDag-Erling Smørgrav.Xr fetch 3
91b39628e7SDag-Erling Smørgravlibrary.
92b39628e7SDag-Erling SmørgravIts purpose is to retrieve the file(s) pointed to by the URL(s) on the
93b39628e7SDag-Erling Smørgravcommand line.
947fefc698SJordan K. Hubbard.Pp
957fefc698SJordan K. HubbardThe following options are available:
9676dafb89SGarrett Wollman.Bl -tag -width Fl
97dcd47379SDag-Erling Smørgrav.It Fl 1 , -one-file
98b39628e7SDag-Erling SmørgravStop and return exit code 0 at the first successfully retrieved file.
99dcd47379SDag-Erling Smørgrav.It Fl 4 , -ipv4-only
100b39628e7SDag-Erling SmørgravForces
101b39628e7SDag-Erling Smørgrav.Nm
102b39628e7SDag-Erling Smørgravto use IPv4 addresses only.
103dcd47379SDag-Erling Smørgrav.It Fl 6 , -ipv6-only
104b39628e7SDag-Erling SmørgravForces
105b39628e7SDag-Erling Smørgrav.Nm
106b39628e7SDag-Erling Smørgravto use IPv6 addresses only.
107dcd47379SDag-Erling Smørgrav.It Fl A , -no-redirect
108b39628e7SDag-Erling SmørgravDo not automatically follow ``temporary'' (302) redirects.
109b39628e7SDag-Erling SmørgravSome broken Web sites will return a redirect instead of a not-found
110b39628e7SDag-Erling Smørgraverror when the requested object does not exist.
111dcd47379SDag-Erling Smørgrav.It Fl a , -retry
1122494e810SGarrett WollmanAutomatically retry the transfer upon soft failures.
113dcd47379SDag-Erling Smørgrav.It Fl B Ar bytes , Fl -buffer-size= Ns Ar bytes
114b39628e7SDag-Erling SmørgravSpecify the read buffer size in bytes.
115c2ea176dSDag-Erling SmørgravThe default is 16,384 bytes.
116b39628e7SDag-Erling SmørgravAttempts to set a buffer size lower than this will be silently
117b39628e7SDag-Erling Smørgravignored.
118b39628e7SDag-Erling SmørgravThe number of reads actually performed is reported at verbosity level
119b39628e7SDag-Erling Smørgravtwo or higher (see the
120b39628e7SDag-Erling Smørgrav.Fl v
121b39628e7SDag-Erling Smørgravflag).
122dcd47379SDag-Erling Smørgrav.It Fl -bind-address= Ns Ar host
123dcd47379SDag-Erling SmørgravSpecifies a hostname or IP address to which sockets used for outgoing
124dcd47379SDag-Erling Smørgravconnections will be bound.
12578be3199SGarrett Wollman.It Fl c Ar dir
12678be3199SGarrett WollmanThe file to retrieve is in directory
12778be3199SGarrett Wollman.Ar dir
12878be3199SGarrett Wollmanon the remote host.
129047843ddSDag-Erling SmørgravThis option is deprecated and is provided for backward compatibility
130047843ddSDag-Erling Smørgravonly.
131dcd47379SDag-Erling Smørgrav.It Fl -ca-cert= Ns Ar file
132dcd47379SDag-Erling Smørgrav[SSL]
133dcd47379SDag-Erling SmørgravPath to certificate bundle containing trusted CA certificates.
134*2821a749SDag-Erling SmørgravOtherwise,
1351ec923fdSMichael GmelinOpenSSL's default CA cert and path settings apply.
136dcd47379SDag-Erling Smørgrav.It Fl -ca-path= Ns Ar dir
137dcd47379SDag-Erling Smørgrav[SSL]
138dcd47379SDag-Erling SmørgravThe directory
139dcd47379SDag-Erling Smørgrav.Ar dir
140dcd47379SDag-Erling Smørgravcontains trusted CA hashes.
141dcd47379SDag-Erling Smørgrav.It Fl -cert= Ns Ar file
142dcd47379SDag-Erling Smørgrav[SSL]
143dcd47379SDag-Erling Smørgrav.Ar file
144dcd47379SDag-Erling Smørgravis a PEM encoded client certificate/key which will be used in
145dcd47379SDag-Erling Smørgravclient certificate authentication.
146dcd47379SDag-Erling Smørgrav.It Fl -crl= Ns Ar file
147dcd47379SDag-Erling Smørgrav[SSL]
148dcd47379SDag-Erling SmørgravPoints to certificate revocation list
149dcd47379SDag-Erling Smørgrav.Ar file ,
150dcd47379SDag-Erling Smørgravwhich has to be in PEM format and may contain peer certificates that have
151dcd47379SDag-Erling Smørgravbeen revoked.
152dcd47379SDag-Erling Smørgrav.It Fl d , -direct
153047843ddSDag-Erling SmørgravUse a direct connection even if a proxy is configured.
154dcd47379SDag-Erling Smørgrav.It Fl F , -force-restart
155b39628e7SDag-Erling SmørgravIn combination with the
156d6a8296aSBrian Feldman.Fl r
157b39628e7SDag-Erling Smørgravflag, forces a restart even if the local and remote files have
158b39628e7SDag-Erling Smørgravdifferent modification times.
1591bbb80b6SDag-Erling SmørgravImplies
1601bbb80b6SDag-Erling Smørgrav.Fl R .
16178be3199SGarrett Wollman.It Fl f Ar file
16278be3199SGarrett WollmanThe file to retrieve is named
16378be3199SGarrett Wollman.Ar file
16478be3199SGarrett Wollmanon the remote host.
165047843ddSDag-Erling SmørgravThis option is deprecated and is provided for backward compatibility
166047843ddSDag-Erling Smørgravonly.
16778be3199SGarrett Wollman.It Fl h Ar host
16878be3199SGarrett WollmanThe file to retrieve is located on the host
16978be3199SGarrett Wollman.Ar host .
170047843ddSDag-Erling SmørgravThis option is deprecated and is provided for backward compatibility
171047843ddSDag-Erling Smørgravonly.
172dcd47379SDag-Erling Smørgrav.It Fl i Ar file , Fl -if-modified-since= Ns Ar file
1737f92799fSMurray StokelyIf-Modified-Since mode: the remote file will only be retrieved if it
1747f92799fSMurray Stokelyis newer than
1757f92799fSMurray Stokely.Ar file
1767f92799fSMurray Stokelyon the local host.
1777f92799fSMurray Stokely(HTTP only)
178dcd47379SDag-Erling Smørgrav.It Fl -key= Ns Ar file
179dcd47379SDag-Erling Smørgrav[SSL]
180dcd47379SDag-Erling Smørgrav.Ar file
181dcd47379SDag-Erling Smørgravis a PEM encoded client key that will be used in client certificate
182dcd47379SDag-Erling Smørgravauthentication in case key and client certificate are stored separately.
183dcd47379SDag-Erling Smørgrav.It Fl l , -symlink
184b39628e7SDag-Erling SmørgravIf the target is a file-scheme URL, make a symbolic link to the target
185b39628e7SDag-Erling Smørgravrather than trying to copy it.
1867fefc698SJordan K. Hubbard.It Fl M
187dcd47379SDag-Erling Smørgrav.It Fl m , -mirror
1880b474bc6SDag-Erling SmørgravMirror mode: if the file already exists locally and has the same size
1890b474bc6SDag-Erling Smørgravand modification time as the remote file, it will not be fetched.
190c0b0d54eSDag-Erling SmørgravNote that the
191c0b0d54eSDag-Erling Smørgrav.Fl m
192c0b0d54eSDag-Erling Smørgravand
193c0b0d54eSDag-Erling Smørgrav.Fl r
194c0b0d54eSDag-Erling Smørgravflags are mutually exclusive.
195dcd47379SDag-Erling Smørgrav.It Fl N Ar file , Fl -netrc= Ns Ar file
1967dcb0a0eSDag-Erling SmørgravUse
1977dcb0a0eSDag-Erling Smørgrav.Ar file
1987dcb0a0eSDag-Erling Smørgravinstead of
1997dcb0a0eSDag-Erling Smørgrav.Pa ~/.netrc
2007dcb0a0eSDag-Erling Smørgravto look up login names and passwords for FTP sites.
2017dcb0a0eSDag-Erling SmørgravSee
2027dcb0a0eSDag-Erling Smørgrav.Xr ftp 1
2037dcb0a0eSDag-Erling Smørgravfor a description of the file format.
2047dcb0a0eSDag-Erling SmørgravThis feature is experimental.
205dcd47379SDag-Erling Smørgrav.It Fl n , -no-mtime
2060227791bSRuslan ErmilovDo not preserve the modification time of the transferred file.
207dcd47379SDag-Erling Smørgrav.It Fl -no-passive
208dcd47379SDag-Erling SmørgravForces the FTP code to use active mode.
209dcd47379SDag-Erling Smørgrav.It Fl -no-proxy= Ns Ar list
210dcd47379SDag-Erling SmørgravEither a single asterisk, which disables the use of proxies
211dcd47379SDag-Erling Smørgravaltogether, or a comma- or whitespace-separated list of hosts for
212dcd47379SDag-Erling Smørgravwhich proxies should not be used.
213dcd47379SDag-Erling Smørgrav.It Fl -no-sslv3
214dcd47379SDag-Erling Smørgrav[SSL]
2151ec923fdSMichael GmelinDo not allow SSL version 3 when negotiating the connection.
2161ec923fdSMichael GmelinThis option is deprecated and is provided for backward compatibility
2171ec923fdSMichael Gmelinonly.
2181ec923fdSMichael GmelinSSLv3 is disabled by default.
2191ec923fdSMichael GmelinSet
2201ec923fdSMichael Gmelin.Ev SSL_ALLOW_SSL3
2211ec923fdSMichael Gmelinto change this behavior.
222dcd47379SDag-Erling Smørgrav.It Fl -no-tlsv1
223dcd47379SDag-Erling Smørgrav[SSL]
2241ec923fdSMichael GmelinDo not allow TLS version 1 when negotiating the connection.
225dcd47379SDag-Erling Smørgrav.It Fl -no-verify-hostname
226dcd47379SDag-Erling Smørgrav[SSL]
227dcd47379SDag-Erling SmørgravDo not verify that the hostname matches the subject of the
228dcd47379SDag-Erling Smørgravcertificate presented by the server.
229dcd47379SDag-Erling Smørgrav.It Fl -no-verify-peer
230dcd47379SDag-Erling Smørgrav[SSL]
231dcd47379SDag-Erling SmørgravDo not verify the peer certificate against trusted CAs.
232b24eca8bSBenjamin Kaduk.It Fl o Ar file , Fl -output= Ns Ar file
23378be3199SGarrett WollmanSet the output file name to
23478be3199SGarrett Wollman.Ar file .
23578be3199SGarrett WollmanBy default, a ``pathname'' is extracted from the specified URI, and
236b39628e7SDag-Erling Smørgravits basename is used as the name of the output file.
237b39628e7SDag-Erling SmørgravA
23878be3199SGarrett Wollman.Ar file
23978be3199SGarrett Wollmanargument of
24078be3199SGarrett Wollman.Sq Li \&-
24178be3199SGarrett Wollmanindicates that results are to be directed to the standard output.
242fe6a0485SColin PercivalIf the
243fe6a0485SColin Percival.Ar file
244fe6a0485SColin Percivalargument is a directory, fetched file(s) will be placed within the
245fe6a0485SColin Percivaldirectory, with name(s) selected as in the default behaviour.
2467fefc698SJordan K. Hubbard.It Fl P
247dcd47379SDag-Erling Smørgrav.It Fl p , -passive
248b39628e7SDag-Erling SmørgravUse passive FTP.
249bb6e3329SDag-Erling SmørgravThese flags have no effect, since passive FTP is the default, but are
250bb6e3329SDag-Erling Smørgravprovided for compatibility with earlier versions where active FTP was
251bb6e3329SDag-Erling Smørgravthe default.
252dcd47379SDag-Erling SmørgravTo force active mode, use the
253dcd47379SDag-Erling Smørgrav.Fl -no-passive
254dcd47379SDag-Erling Smørgravflag or set the
255bb6e3329SDag-Erling Smørgrav.Ev FTP_PASSIVE_MODE
256bb6e3329SDag-Erling Smørgravenvironment variable to
257bb6e3329SDag-Erling Smørgrav.Ql NO .
258dcd47379SDag-Erling Smørgrav.It Fl -referer= Ns Ar URL
259dcd47379SDag-Erling SmørgravSpecifies the referrer URL to use for HTTP requests.
260dcd47379SDag-Erling SmørgravIf
261dcd47379SDag-Erling Smørgrav.Ar URL
262dcd47379SDag-Erling Smørgravis set to
263dcd47379SDag-Erling Smørgrav.Dq auto ,
264dcd47379SDag-Erling Smørgravthe document URL will be used as referrer URL.
265dcd47379SDag-Erling Smørgrav.It Fl q , -quiet
26687faa07bSSheldon HearnQuiet mode.
267dcd47379SDag-Erling Smørgrav.It Fl R , -keep-output
268b39628e7SDag-Erling SmørgravThe output files are precious, and should not be deleted under any
269b39628e7SDag-Erling Smørgravcircumstances, even if the transfer failed or was incomplete.
270dcd47379SDag-Erling Smørgrav.It Fl r , -restart
27178be3199SGarrett WollmanRestart a previously interrupted transfer.
272c0b0d54eSDag-Erling SmørgravNote that the
273c0b0d54eSDag-Erling Smørgrav.Fl m
274c0b0d54eSDag-Erling Smørgravand
275c0b0d54eSDag-Erling Smørgrav.Fl r
276c0b0d54eSDag-Erling Smørgravflags are mutually exclusive.
277dcd47379SDag-Erling Smørgrav.It Fl S Ar bytes , Fl -require-size= Ns Ar bytes
278b39628e7SDag-Erling SmørgravRequire the file size reported by the server to match the specified
279b39628e7SDag-Erling Smørgravvalue.
280b39628e7SDag-Erling SmørgravIf it does not, a message is printed and the file is not fetched.
281b39628e7SDag-Erling SmørgravIf the server does not support reporting file sizes, this option is
282b39628e7SDag-Erling Smørgravignored and the file is fetched unconditionally.
283dcd47379SDag-Erling Smørgrav.It Fl s , -print-size
284b39628e7SDag-Erling SmørgravPrint the size in bytes of each requested file, without fetching it.
285dcd47379SDag-Erling Smørgrav.It Fl T Ar seconds , Fl -timeout= Ns Ar seconds
286fc6fcbf9SJordan K. HubbardSet timeout value to
287fc6fcbf9SJordan K. Hubbard.Ar seconds .
288a43a248cSPeter WemmOverrides the environment variables
289fc6fcbf9SJordan K. Hubbard.Ev FTP_TIMEOUT
290b39628e7SDag-Erling Smørgravfor FTP transfers or
291a43a248cSPeter Wemm.Ev HTTP_TIMEOUT
292b39628e7SDag-Erling Smørgravfor HTTP transfers if set.
293dcd47379SDag-Erling Smørgrav.It Fl U , -passive-portrange-default
2947c480c6cSDag-Erling SmørgravWhen using passive FTP, allocate the port for the data connection from
2957c480c6cSDag-Erling Smørgravthe low (default) port range.
2967c480c6cSDag-Erling SmørgravSee
2977c480c6cSDag-Erling Smørgrav.Xr ip 4
2987c480c6cSDag-Erling Smørgravfor details on how to specify which port range this corresponds to.
299dcd47379SDag-Erling Smørgrav.It Fl -user-agent= Ns Ar agent-string
300dcd47379SDag-Erling SmørgravSpecifies the User-Agent string to use for HTTP requests.
301dcd47379SDag-Erling SmørgravThis can be useful when working with HTTP origin or proxy servers that
302dcd47379SDag-Erling Smørgravdifferentiate between user agents.
303dcd47379SDag-Erling Smørgrav.It Fl v , -verbose
30438a616e4SDag-Erling SmørgravIncrease verbosity level.
305dcd47379SDag-Erling Smørgrav.It Fl w Ar seconds , Fl -retry-delay= Ns Ar seconds
306b39628e7SDag-Erling SmørgravWhen the
307b39628e7SDag-Erling Smørgrav.Fl a
308b39628e7SDag-Erling Smørgravflag is specified, wait this many seconds between successive retries.
3097fefc698SJordan K. Hubbard.El
310ab47d799SRuslan Ermilov.Pp
311ab47d799SRuslan ErmilovIf
312ab47d799SRuslan Ermilov.Nm
313ab47d799SRuslan Ermilovreceives a
314ab47d799SRuslan Ermilov.Dv SIGINFO
315ab47d799SRuslan Ermilovsignal (see the
316ab47d799SRuslan Ermilov.Cm status
317ab47d799SRuslan Ermilovargument for
318ab47d799SRuslan Ermilov.Xr stty 1 ) ,
319ab47d799SRuslan Ermilovthe current transfer rate statistics will be written to the
320ab47d799SRuslan Ermilovstandard error output, in the same format as the standard completion
321ab47d799SRuslan Ermilovmessage.
3227fefc698SJordan K. Hubbard.Sh ENVIRONMENT
32309d2d42eSWes Peters.Bl -tag -width HTTP_TIMEOUT
32409d2d42eSWes Peters.It Ev FTP_TIMEOUT
3250fc781ffSDag-Erling SmørgravMaximum time, in seconds, to wait before aborting an FTP connection.
32609d2d42eSWes Peters.It Ev HTTP_TIMEOUT
3270fc781ffSDag-Erling SmørgravMaximum time, in seconds, to wait before aborting an HTTP connection.
328cec5287bSWes Peters.El
32909d2d42eSWes Peters.Pp
3300fc781ffSDag-Erling SmørgravSee
33109d2d42eSWes Peters.Xr fetch 3
3320fc781ffSDag-Erling Smørgravfor a description of additional environment variables, including
3330fc781ffSDag-Erling Smørgrav.Ev FETCH_BIND_ADDRESS ,
3340fc781ffSDag-Erling Smørgrav.Ev FTP_LOGIN ,
3350fc781ffSDag-Erling Smørgrav.Ev FTP_PASSIVE_MODE ,
3360fc781ffSDag-Erling Smørgrav.Ev FTP_PASSWORD ,
3370fc781ffSDag-Erling Smørgrav.Ev FTP_PROXY ,
3380fc781ffSDag-Erling Smørgrav.Ev ftp_proxy ,
3391453595fSDag-Erling Smørgrav.Ev HTTP_ACCEPT ,
3400fc781ffSDag-Erling Smørgrav.Ev HTTP_AUTH ,
3410fc781ffSDag-Erling Smørgrav.Ev HTTP_PROXY ,
3420fc781ffSDag-Erling Smørgrav.Ev http_proxy ,
3430fc781ffSDag-Erling Smørgrav.Ev HTTP_PROXY_AUTH ,
3440fc781ffSDag-Erling Smørgrav.Ev HTTP_REFERER ,
3450fc781ffSDag-Erling Smørgrav.Ev HTTP_USER_AGENT ,
3460fc781ffSDag-Erling Smørgrav.Ev NETRC ,
347dcd47379SDag-Erling Smørgrav.Ev NO_PROXY ,
348dcd47379SDag-Erling Smørgrav.Ev no_proxy ,
349dcd47379SDag-Erling Smørgrav.Ev SSL_CA_CERT_FILE ,
350dcd47379SDag-Erling Smørgrav.Ev SSL_CA_CERT_PATH ,
351dcd47379SDag-Erling Smørgrav.Ev SSL_CLIENT_CERT_FILE ,
352dcd47379SDag-Erling Smørgrav.Ev SSL_CLIENT_KEY_FILE ,
353dcd47379SDag-Erling Smørgrav.Ev SSL_CRL_FILE ,
3541ec923fdSMichael Gmelin.Ev SSL_ALLOW_SSL3 ,
355dcd47379SDag-Erling Smørgrav.Ev SSL_NO_TLS1 ,
3561ec923fdSMichael Gmelin.Ev SSL_NO_TLS1_1 ,
3571ec923fdSMichael Gmelin.Ev SSL_NO_TLS1_2 ,
358dcd47379SDag-Erling Smørgrav.Ev SSL_NO_VERIFY_HOSTNAME
359011a8335SDag-Erling Smørgravand
360dcd47379SDag-Erling Smørgrav.Ev SSL_NO_VERIFY_PEER .
3616c7216dfSRuslan Ermilov.Sh EXIT STATUS
3626c7216dfSRuslan ErmilovThe
3636c7216dfSRuslan Ermilov.Nm
3646c7216dfSRuslan Ermilovcommand returns zero on success, or one on failure.
3656c7216dfSRuslan ErmilovIf multiple URLs are listed on the command line,
3666c7216dfSRuslan Ermilov.Nm
367ee8e4b36SJoseph Koshywill attempt to retrieve each one of them in turn, and will return
368ee8e4b36SJoseph Koshyzero only if they were all successfully retrieved.
3697f92799fSMurray Stokely.Pp
3707f92799fSMurray StokelyIf the
3717f92799fSMurray Stokely.Fl i
3727f92799fSMurray Stokelyargument is used and the remote file is not newer than the
3737f92799fSMurray Stokelyspecified file then the command will still return success,
3747f92799fSMurray Stokelyalthough no file is transferred.
375538d212dSFernando Apesteguía.Sh EXAMPLES
376538d212dSFernando ApesteguíaSilently try to fetch the URLs passed as parameters.
377538d212dSFernando ApesteguíaThe first one will fail.
378538d212dSFernando ApesteguíaIf the second URL succeeds the third one will not be tried:
379538d212dSFernando Apesteguía.Bd -literal -offset indent
38086e149e1SFernando Apesteguía$ fetch -1 -q https://www.freebsd.org/bad.html \e
38186e149e1SFernando Apesteguía	ftp.freebsd.org/pub/FreeBSD/README.TXT \e
382538d212dSFernando Apesteguía	https://www.fake.url
383538d212dSFernando Apesteguíafetch: https://www.freebsd.org/bad.html: Not Found
384538d212dSFernando Apesteguía.Ed
385538d212dSFernando Apesteguía.Pp
386538d212dSFernando ApesteguíaBe verbose when retrieving the
38786e149e1SFernando Apesteguía.Pa README.TXT
388538d212dSFernando Apesteguíafile:
389538d212dSFernando Apesteguía.Bd -literal -offset indent
390538d212dSFernando Apesteguía$ fetch -v ftp.freebsd.org/pub/FreeBSD/README.TXT
391538d212dSFernando Apesteguíaresolving server address: ftp.freebsd.org:80
392538d212dSFernando Apesteguíarequesting http://ftp.freebsd.org/pub/FreeBSD/README.TXT
393538d212dSFernando Apesteguíalocal size / mtime: 4259 / 1431015519
394538d212dSFernando Apesteguíaremote size / mtime: 4259 / 1431015519
395538d212dSFernando ApesteguíaREADME.TXT                                            4259  B   44 MBps    00s
396538d212dSFernando Apesteguía.Ed
397538d212dSFernando Apesteguía.Pp
398538d212dSFernando ApesteguíaQuietly save the
39986e149e1SFernando Apesteguía.Pa README.TXT
40086e149e1SFernando Apesteguíafile as
40186e149e1SFernando Apesteguía.Pa myreadme.txt
402538d212dSFernando Apesteguíaand do not delete the output file under any circumstances:
403538d212dSFernando Apesteguía.Bd -literal -offset indent
404538d212dSFernando Apesteguíafetch -o myreadme.txt -q -R ftp.freebsd.org/pub/FreeBSD/README.TXT
405538d212dSFernando Apesteguía.Ed
406538d212dSFernando Apesteguía.Pp
407538d212dSFernando ApesteguíaPrint the size of the requested file and identify the request with a custom user
408538d212dSFernando Apesteguíaagent string:
409538d212dSFernando Apesteguía.Bd -literal -offset indent
410538d212dSFernando Apesteguía$ fetch -s ftp.freebsd.org/pub/FreeBSD/README.TXT
411538d212dSFernando Apesteguía--user-agent="Mozilla/5.0 (X11; FreeBSD x86_64; rv:78.0) Gecko/20100101"
412538d212dSFernando Apesteguía3513231
413538d212dSFernando Apesteguía.Ed
414538d212dSFernando Apesteguía.Pp
415538d212dSFernando ApesteguíaRestart the transfer of the
41686e149e1SFernando Apesteguía.Pa README.TXT
417538d212dSFernando Apesteguíafile and retry the transfer upon soft failures:
418538d212dSFernando Apesteguía.Bd -literal -offset indent
419538d212dSFernando Apesteguía$ fetch -a -r http://ftp.freebsd.org/pub/FreeBSD/README.TXT
420538d212dSFernando Apesteguía.Ed
4217fefc698SJordan K. Hubbard.Sh SEE ALSO
42243a623c8SEdward Tomasz Napierala.Xr fetch 3 ,
42343a623c8SEdward Tomasz Napierala.Xr phttpget 8
4247fefc698SJordan K. Hubbard.Sh HISTORY
4257fefc698SJordan K. HubbardThe
426b39628e7SDag-Erling Smørgrav.Nm
42785cf659aSMike Pritchardcommand appeared in
42885cf659aSMike Pritchard.Fx 2.1.5 .
429b39628e7SDag-Erling SmørgravThis implementation first appeared in
430b39628e7SDag-Erling Smørgrav.Fx 4.1 .
43178be3199SGarrett Wollman.Sh AUTHORS
432f4d874a1SRuslan Ermilov.An -nosplit
43378be3199SGarrett WollmanThe original implementation of
43478be3199SGarrett Wollman.Nm
435306005e7SPhilippe Charnierwas done by
4362b7af31cSBaptiste Daroussin.An Jean-Marc Zucconi Aq Mt jmz@FreeBSD.org .
437306005e7SPhilippe CharnierIt was extensively re-worked for
438bc5d5816SWolfram Schneider.Fx 2.2
439306005e7SPhilippe Charnierby
4402b7af31cSBaptiste Daroussin.An Garrett Wollman Aq Mt wollman@FreeBSD.org ,
441b39628e7SDag-Erling Smørgravand later completely rewritten to use the
442b39628e7SDag-Erling Smørgrav.Xr fetch 3
443b39628e7SDag-Erling Smørgravlibrary by
4442b7af31cSBaptiste Daroussin.An Dag-Erling Sm\(/orgrav Aq Mt des@FreeBSD.org
445dcd47379SDag-Erling Smørgravand
4462b7af31cSBaptiste Daroussin.An Michael Gmelin Aq Mt freebsd@grem.de .
447b39628e7SDag-Erling Smørgrav.Sh NOTES
4482494e810SGarrett WollmanThe
4490c8cc99eSGarrett Wollman.Fl b
450b39628e7SDag-Erling Smørgravand
451b39628e7SDag-Erling Smørgrav.Fl t
452b39628e7SDag-Erling Smørgravoptions are no longer supported and will generate warnings.
453b39628e7SDag-Erling SmørgravThey were workarounds for bugs in other OSes which this implementation
454b39628e7SDag-Erling Smørgravdoes not trigger.
455c1468430SGarrett Wollman.Pp
456047843ddSDag-Erling SmørgravOne cannot both use the
457047843ddSDag-Erling Smørgrav.Fl h ,
458cf575052SBen Smithurst.Fl c
459cf575052SBen Smithurstand
460b39628e7SDag-Erling Smørgrav.Fl f
461047843ddSDag-Erling Smørgravoptions and specify URLs on the command line.
462