head 1.5; access; symbols pkgsrc-2023Q4:1.5.0.84 pkgsrc-2023Q4-base:1.5 pkgsrc-2023Q3:1.5.0.82 pkgsrc-2023Q3-base:1.5 pkgsrc-2023Q2:1.5.0.80 pkgsrc-2023Q2-base:1.5 pkgsrc-2023Q1:1.5.0.78 pkgsrc-2023Q1-base:1.5 pkgsrc-2022Q4:1.5.0.76 pkgsrc-2022Q4-base:1.5 pkgsrc-2022Q3:1.5.0.74 pkgsrc-2022Q3-base:1.5 pkgsrc-2022Q2:1.5.0.72 pkgsrc-2022Q2-base:1.5 pkgsrc-2022Q1:1.5.0.70 pkgsrc-2022Q1-base:1.5 pkgsrc-2021Q4:1.5.0.68 pkgsrc-2021Q4-base:1.5 pkgsrc-2021Q3:1.5.0.66 pkgsrc-2021Q3-base:1.5 pkgsrc-2021Q2:1.5.0.64 pkgsrc-2021Q2-base:1.5 pkgsrc-2021Q1:1.5.0.62 pkgsrc-2021Q1-base:1.5 pkgsrc-2020Q4:1.5.0.60 pkgsrc-2020Q4-base:1.5 pkgsrc-2020Q3:1.5.0.58 pkgsrc-2020Q3-base:1.5 pkgsrc-2020Q2:1.5.0.54 pkgsrc-2020Q2-base:1.5 pkgsrc-2020Q1:1.5.0.34 pkgsrc-2020Q1-base:1.5 pkgsrc-2019Q4:1.5.0.56 pkgsrc-2019Q4-base:1.5 pkgsrc-2019Q3:1.5.0.52 pkgsrc-2019Q3-base:1.5 pkgsrc-2019Q2:1.5.0.50 pkgsrc-2019Q2-base:1.5 pkgsrc-2019Q1:1.5.0.48 pkgsrc-2019Q1-base:1.5 pkgsrc-2018Q4:1.5.0.46 pkgsrc-2018Q4-base:1.5 pkgsrc-2018Q3:1.5.0.44 pkgsrc-2018Q3-base:1.5 pkgsrc-2018Q2:1.5.0.42 pkgsrc-2018Q2-base:1.5 pkgsrc-2018Q1:1.5.0.40 pkgsrc-2018Q1-base:1.5 pkgsrc-2017Q4:1.5.0.38 pkgsrc-2017Q4-base:1.5 pkgsrc-2017Q3:1.5.0.36 pkgsrc-2017Q3-base:1.5 pkgsrc-2017Q2:1.5.0.32 pkgsrc-2017Q2-base:1.5 pkgsrc-2017Q1:1.5.0.30 pkgsrc-2017Q1-base:1.5 pkgsrc-2016Q4:1.5.0.28 pkgsrc-2016Q4-base:1.5 pkgsrc-2016Q3:1.5.0.26 pkgsrc-2016Q3-base:1.5 pkgsrc-2016Q2:1.5.0.24 pkgsrc-2016Q2-base:1.5 pkgsrc-2016Q1:1.5.0.22 pkgsrc-2016Q1-base:1.5 pkgsrc-2015Q4:1.5.0.20 pkgsrc-2015Q4-base:1.5 pkgsrc-2015Q3:1.5.0.18 pkgsrc-2015Q3-base:1.5 pkgsrc-2015Q2:1.5.0.16 pkgsrc-2015Q2-base:1.5 pkgsrc-2015Q1:1.5.0.14 pkgsrc-2015Q1-base:1.5 pkgsrc-2014Q4:1.5.0.12 pkgsrc-2014Q4-base:1.5 pkgsrc-2014Q3:1.5.0.10 pkgsrc-2014Q3-base:1.5 pkgsrc-2014Q2:1.5.0.8 pkgsrc-2014Q2-base:1.5 pkgsrc-2014Q1:1.5.0.6 pkgsrc-2014Q1-base:1.5 pkgsrc-2013Q4:1.5.0.4 pkgsrc-2013Q4-base:1.5 pkgsrc-2013Q3:1.5.0.2 pkgsrc-2013Q3-base:1.5 pkgsrc-2013Q2:1.4.0.36 pkgsrc-2013Q2-base:1.4 pkgsrc-2013Q1:1.4.0.34 pkgsrc-2013Q1-base:1.4 pkgsrc-2012Q4:1.4.0.32 pkgsrc-2012Q4-base:1.4 pkgsrc-2012Q3:1.4.0.30 pkgsrc-2012Q3-base:1.4 pkgsrc-2012Q2:1.4.0.28 pkgsrc-2012Q2-base:1.4 pkgsrc-2012Q1:1.4.0.26 pkgsrc-2012Q1-base:1.4 pkgsrc-2011Q4:1.4.0.24 pkgsrc-2011Q4-base:1.4 pkgsrc-2011Q3:1.4.0.22 pkgsrc-2011Q3-base:1.4 pkgsrc-2011Q2:1.4.0.20 pkgsrc-2011Q2-base:1.4 pkgsrc-2011Q1:1.4.0.18 pkgsrc-2011Q1-base:1.4 pkgsrc-2010Q4:1.4.0.16 pkgsrc-2010Q4-base:1.4 pkgsrc-2010Q3:1.4.0.14 pkgsrc-2010Q3-base:1.4 pkgsrc-2010Q2:1.4.0.12 pkgsrc-2010Q2-base:1.4 pkgsrc-2010Q1:1.4.0.10 pkgsrc-2010Q1-base:1.4 pkgsrc-2009Q4:1.4.0.8 pkgsrc-2009Q4-base:1.4 pkgsrc-2009Q3:1.4.0.6 pkgsrc-2009Q3-base:1.4 pkgsrc-2009Q2:1.4.0.4 pkgsrc-2009Q2-base:1.4 pkgsrc-2009Q1:1.4.0.2 pkgsrc-2009Q1-base:1.4 pkgsrc-2008Q4:1.1.1.1.0.2 pkgsrc-2008Q4-base:1.1.1.1 pkgsrc-base:1.1.1.1 TNF:1.1.1; locks; strict; comment @.\" @; 1.5 date 2013.07.20.21.50.52; author wiz; state Exp; branches; next 1.4; commitid JkeZW8O0bOxzYfYw; 1.4 date 2009.02.07.15.25.51; author wiz; state Exp; branches; next 1.3; 1.3 date 2009.02.05.22.19.57; author joerg; state Exp; branches; next 1.2; 1.2 date 2009.02.05.17.14.06; author joerg; state Exp; branches; next 1.1; 1.1 date 2008.10.08.15.28.30; author joerg; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2008.10.08.15.28.30; author joerg; state Exp; branches; next ; desc @@ 1.5 log @Use Mt for email addresses. @ text @.\" $NetBSD: fetch.1,v 1.4 2009/02/07 15:25:51 wiz Exp $ .\"- .\" Copyright (c) 2000-2004 Dag-Erling Coïdan Smørgrav .\" All rights reserved. .\" Portions Copyright (c) 1999 Massachusetts Institute of Technology; used .\" by permission. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer .\" in this position and unchanged. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. The name of the author may not be used to endorse or promote products .\" derived from this software without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" $FreeBSD$ .\" .Dd February 5, 2009 .Dt FETCH 1 .Os .Sh NAME .Nm fetch .Nd retrieve a file by Uniform Resource Locator .Sh SYNOPSIS .Nm .Op Fl 146AFMRUadilmnqrsv .Op Fl B Ar bytes .Op Fl N Ar file .Op Fl o Ar file .Op Fl S Ar bytes .Op Fl T Ar seconds .Op Fl w Ar seconds .Op Ar URL ... .Sh DESCRIPTION The .Nm utility provides a command-line interface to the .Xr fetch 3 library. Its purpose is to retrieve the file(s) pointed to by the URL(s) on the command line. .Pp The following options are available: .Bl -tag -width Fl .It Fl 1 Stop and return exit code 0 at the first successfully retrieved file. .It Fl 4 Forces .Nm to use IPv4 addresses only. .It Fl 6 Forces .Nm to use IPv6 addresses only. .It Fl A Do not automatically follow .Dq temporary (302) redirects. Some broken Web sites will return a redirect instead of a not-found error when the requested object does not exist. .It Fl a Automatically retry the transfer upon soft failures. .It Fl B Ar bytes Specify the read buffer size in bytes. The default is 4096 bytes. Attempts to set a buffer size lower than this will be silently ignored. The number of reads actually performed is reported at verbosity level two or higher (see the .Fl v flag). .It Fl d Use a direct connection even if a proxy is configured. .It Fl F In combination with the .Fl r flag, forces a restart even if the local and remote files have different modification times. Implies .Fl R . .It Fl i Only fetch if it the output file is older than the referenced URL. This option is overriden by .Fl o Ar - . .It Fl l If the target is a file-scheme URL, make a symbolic link to the target rather than trying to copy it. .It Fl M .It Fl m Mirror mode: if the file already exists locally and has the same size and modification time as the remote file, it will not be fetched. Note that the .Fl m and .Fl r flags are mutually exclusive. .It Fl N Ar file Use .Ar file instead of .Pa ~/.netrc to look up login names and passwords for FTP sites. See .Xr ftp 1 for a description of the file format. This feature is experimental. .It Fl n Do not preserve the modification time of the transferred file. .It Fl o Ar file Set the output file name to .Ar file . By default, a .Dq pathname is extracted from the specified URI, and its basename is used as the name of the output file. A .Ar file argument of .Sq Li \&- indicates that results are to be directed to the standard output. If the .Ar file argument is a directory, fetched file(s) will be placed within the directory, with name(s) selected as in the default behaviour. .It Fl q Quiet mode. .It Fl R The output files are precious, and should not be deleted under any circumstances, even if the transfer failed or was incomplete. .It Fl r Restart a previously interrupted transfer. Note that the .Fl m and .Fl r flags are mutually exclusive. .It Fl S Ar bytes Require the file size reported by the server to match the specified value. If it does not, a message is printed and the file is not fetched. If the server does not support reporting file sizes, this option is ignored and the file is fetched unconditionally. .It Fl s Print the size in bytes of each requested file, without fetching it. .It Fl T Ar seconds Set timeout value to .Ar seconds . Overrides the environment variables .Ev FTP_TIMEOUT for FTP transfers or .Ev HTTP_TIMEOUT for HTTP transfers if set. .It Fl U When using passive FTP, allocate the port for the data connection from the low (default) port range. See .Xr ip 4 for details on how to specify which port range this corresponds to. .It Fl v Increase verbosity level. .It Fl w Ar seconds When the .Fl a flag is specified, wait this many seconds between successive retries. .El .Pp If .Nm receives a .Dv SIGINFO signal (see the .Cm status argument for .Xr stty 1 ) , the current transfer rate statistics will be written to the standard error output, in the same format as the standard completion message. .Sh EXIT STATUS The .Nm command returns zero on success, or one on failure. If multiple URLs are listed on the command line, .Nm will attempt to retrieve each one of them in turn, and will return zero only if they were all successfully retrieved. .Sh ENVIRONMENT .Bl -tag -width HTTP_TIMEOUT .It Ev FTP_TIMEOUT Maximum time, in seconds, to wait before aborting an FTP connection. .It Ev HTTP_TIMEOUT Maximum time, in seconds, to wait before aborting an HTTP connection. .El .Pp See .Xr fetch 3 for a description of additional environment variables, including .Ev FETCH_BIND_ADDRESS , .Ev FTP_LOGIN , .Ev FTP_PASSIVE_MODE , .Ev FTP_PASSWORD , .Ev FTP_PROXY , .Ev ftp_proxy , .Ev HTTP_AUTH , .Ev HTTP_PROXY , .Ev http_proxy , .Ev HTTP_PROXY_AUTH , .Ev HTTP_REFERER , .Ev HTTP_USER_AGENT , .Ev NETRC , .Ev NO_PROXY and .Ev no_proxy . .Sh SEE ALSO .Xr fetch 3 .Sh HISTORY The .Nm command appeared in .Fx 2.1.5 . This implementation first appeared in .Fx 4.1 . .Sh AUTHORS .An -nosplit The original implementation of .Nm was done by .An Jean-Marc Zucconi Aq Mt jmz@@FreeBSD.org . It was extensively re-worked for .Fx 2.2 by .An Garrett Wollman Aq Mt wollman@@FreeBSD.org , and later completely rewritten to use the .Xr fetch 3 library by .An Dag-Erling Sm\(/orgrav Aq Mt des@@FreeBSD.org . .Sh NOTES The .Fl b and .Fl t options are no longer supported and will generate warnings. They were workarounds for bugs in other OSes which this implementation does not trigger. .Pp One cannot both use the .Fl h , .Fl c , and .Fl f options and specify URLs on the command line. @ 1.4 log @Use more markup. Add RCS Id. Add some commas. Sort options. Sort sections. Convert to UTF-8 (only affects comment). @ text @d1 1 a1 1 .\" $NetBSD$ d242 1 a242 1 .An Jean-Marc Zucconi Aq jmz@@FreeBSD.org . d246 1 a246 1 .An Garrett Wollman Aq wollman@@FreeBSD.org , d250 1 a250 1 .An Dag-Erling Sm\(/orgrav Aq des@@FreeBSD.org . @ 1.3 log @fetch-1.3: Remove FreeBSD legacy options. -H was undocumented and ignored, -h / -f / -c could be used to construct FTP URLs in an adhoc fashion. @ text @d1 1 d3 1 a3 1 .\" Copyright (c) 2000-2004 Dag-Erling Coïdan Smørgrav d33 1 a33 1 .Dd March 11, 2003 d43 2 a46 2 .Op Fl N Ar file .Op Fl o Ar file d60 1 a60 1 .It Fl \&1 d71 3 a73 1 Do not automatically follow ``temporary'' (302) redirects. d127 3 a129 1 By default, a ``pathname'' is extracted from the specified URI, and d193 8 d225 2 a226 1 .Ev NO_PROXY and a227 8 .Sh EXIT STATUS The .Nm command returns zero on success, or one on failure. If multiple URLs are listed on the command line, .Nm will attempt to retrieve each one of them in turn, and will return zero only if they were all successfully retrieved. d262 1 a262 1 .Fl c @ 1.2 log @fetch-1.2: Add -i option for conditional fetch, e.g. only fetch the file again, if the remote version is newer. @ text @a46 3 .Op Fl h Ar host .Op Fl c Ar dir .Op Fl f Ar file a83 6 .It Fl c Ar dir The file to retrieve is in directory .Ar dir on the remote host. This option is deprecated and is provided for backward compatibility only. a92 11 .It Fl f Ar file The file to retrieve is named .Ar file on the remote host. This option is deprecated and is provided for backward compatibility only. .It Fl h Ar host The file to retrieve is located on the host .Ar host . This option is deprecated and is provided for backward compatibility only. @ 1.1 log @Initial revision @ text @d40 1 a40 1 .Op Fl 146AFMRUadlmnqrsv d113 4 @ 1.1.1.1 log @Add fetch-1.0 from FreeBSD, the frontend for libfetch(3). @ text @@