FETCH(1) NetBSD General Commands Manual FETCH(1) NNAAMMEE ffeettcchh -- retrieve a file by Uniform Resource Locator SSYYNNOOPPSSIISS ffeettcchh [--114466AAFFMMRRUUaaddiillmmnnqqrrssvv] [--BB _b_y_t_e_s] [--NN _f_i_l_e] [--oo _f_i_l_e] [--SS _b_y_t_e_s] [--TT _s_e_c_o_n_d_s] [--ww _s_e_c_o_n_d_s] [_U_R_L _._._.] DDEESSCCRRIIPPTTIIOONN The ffeettcchh utility provides a command-line interface to the fetch(3) library. Its purpose is to retrieve the file(s) pointed to by the URL(s) on the command line. The following options are available: --11 Stop and return exit code 0 at the first successfully retrieved file. --44 Forces ffeettcchh to use IPv4 addresses only. --66 Forces ffeettcchh to use IPv6 addresses only. --AA Do not automatically follow ``temporary'' (302) redirects. Some broken Web sites will return a redirect instead of a not-found error when the requested object does not exist. --aa Automatically retry the transfer upon soft failures. --BB _b_y_t_e_s 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 --vv flag). --dd Use a direct connection even if a proxy is configured. --FF In combination with the --rr flag, forces a restart even if the local and remote files have different modification times. Implies --RR. --ii Only fetch if it the output file is older than the referenced URL. This option is overriden by --oo _-. --ll If the target is a file-scheme URL, make a symbolic link to the target rather than trying to copy it. --MM --mm 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 --mm and --rr flags are mutually exclusive. --NN _f_i_l_e Use _f_i_l_e instead of _~_/_._n_e_t_r_c to look up login names and pass- words for FTP sites. See ftp(1) for a description of the file format. This feature is experimental. --nn Do not preserve the modification time of the transferred file. --oo _f_i_l_e Set the output file name to _f_i_l_e. By default, a ``pathname'' is extracted from the specified URI, and its basename is used as the name of the output file. A _f_i_l_e argument of `-' indi- cates that results are to be directed to the standard output. If the _f_i_l_e argument is a directory, fetched file(s) will be placed within the directory, with name(s) selected as in the default behaviour. --qq Quiet mode. --RR The output files are precious, and should not be deleted under any circumstances, even if the transfer failed or was incomplete. --rr Restart a previously interrupted transfer. Note that the --mm and --rr flags are mutually exclusive. --SS _b_y_t_e_s 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. --ss Print the size in bytes of each requested file, without fetching it. --TT _s_e_c_o_n_d_s Set timeout value to _s_e_c_o_n_d_s. Overrides the environment variables FTP_TIMEOUT for FTP transfers or HTTP_TIMEOUT for HTTP transfers if set. --UU When using passive FTP, allocate the port for the data con- nection from the low (default) port range. See ip(4) for details on how to specify which port range this corresponds to. --vv Increase verbosity level. --ww _s_e_c_o_n_d_s When the --aa flag is specified, wait this many seconds between successive retries. If ffeettcchh receives a SIGINFO signal (see the ssttaattuuss argument for stty(1)), the current transfer rate statistics will be written to the standard error output, in the same format as the standard completion message. EEXXIITT SSTTAATTUUSS The ffeettcchh command returns zero on success, or one on failure. If multi- ple URLs are listed on the command line, ffeettcchh will attempt to retrieve each one of them in turn, and will return zero only if they were all suc- cessfully retrieved. EENNVVIIRROONNMMEENNTT FTP_TIMEOUT Maximum time, in seconds, to wait before aborting an FTP connection. HTTP_TIMEOUT Maximum time, in seconds, to wait before aborting an HTTP connection. See fetch(3) for a description of additional environment variables, including FETCH_BIND_ADDRESS, FTP_LOGIN, FTP_PASSIVE_MODE, FTP_PASSWORD, FTP_PROXY, ftp_proxy, HTTP_AUTH, HTTP_PROXY, http_proxy, HTTP_PROXY_AUTH, HTTP_REFERER, HTTP_USER_AGENT, NETRC, NO_PROXY and no_proxy. SSEEEE AALLSSOO fetch(3) HHIISSTTOORRYY The ffeettcchh command appeared in FreeBSD 2.1.5. This implementation first appeared in FreeBSD 4.1. AAUUTTHHOORRSS The original implementation of ffeettcchh was done by Jean-Marc Zucconi . It was extensively re-worked for FreeBSD 2.2 by Garrett Wollman , and later completely rewritten to use the fetch(3) library by Dag-Erling Sm/orgrav . NNOOTTEESS The --bb and --tt options are no longer supported and will generate warnings. They were workarounds for bugs in other OSes which this implementation does not trigger. One cannot both use the --hh, --cc, and --ff options and specify URLs on the command line. NetBSD 5.0 February 5, 2009 NetBSD 5.0