ftpcopy(1)
π ftpcopy β User Commands π
okay bestie, buckle up, this is ftpcopy(1) and it's a whole vibe. section 1 of the manual, user commands, she's iconic, she's been around, and she has opinions.
β¨ NAME β¨
ftpcopy β create and maintain a ftp mirror. yeah. that's her job. she mirrors ftp sites and she does it with main character energy.
πΈ SYNOPSIS πΈ
ftpcopy [options] host[:port] remotedir [localdir]
or: ftpcopy [options] ftp://host[:port]/remotedir [localdir]
π¦ DESCRIPTION π¦
okay so here's the tea: ftpcopy copies a FTP site recursivly (yes, recursively, she said what she said). and then β and this is the part that matters β she goes and deletes all files in the local directory tree which were not found on the remote site. like, full clean-up mode. she does not do clutter. she does not do leftovers. she's giving β¨minimalismβ¨.
so like, local-directory defaults to . β the current working directory β if the --no-delete option is used. and local-directory isn't even needed at all if you're rolling with the --interactive option. otherwise? bestie you must provide a local-directory argument. no ifs, no buts, no exceptions. periodt.
π OPTIONS π
π Connect / login / username / password options:
-u,--user=NAMEβ UseNAMEto login on the ftp server. The default isanonymous. Use an empty name to force the program to not log in. that's right, empty string = she's not logging in, that's on purpose, don't @ her.-p,--pass=PASSWORDβ UsePASSas password to login on the ftp server. The default isanonymous@invalid.example. If an empty password is given the programm will not send a password to the server. lowkey polite of her honestly.--account=ACCOUNTβ SendACCOUNTas account name during login phase. Note: this is not the user name, but the name of what could be called a subaccount implemented by a few servers. If you don't understand what it means you have a good chance to never need this option anyway. and if you think you do need it? please try the--useroption first. she's begging you. π₯Ί--tries=ARGβ Number of tries to connect and log in. The default is1, meaning that the program will give up after the first error. This option was added in version0.3.0.--data-connect-retries=ARGβ Number of tries to connect to data port. The program will try to reach the data port (for retrieval of listings or data) that many times and will give up after that many errors in a row. The default is5, meaning that the program will give up after the fifth error. This option was added in version0.6.6. The old behaviour was to give up after the first error. glow-up fr.--login-sleep=ARGβ Seconds to sleep after a failed login. More precisely: the program will fall to sleep for this many seconds after a try to connect or login has failed. The default is5. A0is treated as1, and abuse, especially together with--tries, is likely to annory the servers adminstrators. π so like. be normal about it. please.-4,--v4β Only use IPv4, even if v6 is available. This option effectively disallows the use of IPv6, except for DNS queries. It was added in version0.6.0.-6,--v6β Only use IPv6, even if v4 is available. This option effectively disallows the use of IPv4, except for DNS queries. It was added in version0.6.0.
π Verbosity options:
-l,--loglevel=ARGβ Controls the amount of logging done. choose your chaos level:0: nothing except warnings and error messages.1: downloads and deletes (this is the default).2: links/symlinks created, files we already got.3: useless stuff.
--bpsβ Log transfer rates. This option causesftpcopyto log byte / kilobyte / megabyte per second information after successful transfers. This option was added in version0.3.9.--progressβ Report progress to stderr. This will print a report of the download every second: a short form of the file name, the bytes got and expected and the percentage received. This option was added in version0.6.0.
π File selection options:
-m,--max-days=DAYSβ Download only files modified in the lastDAYS. Locally existing copies of the not downloaded files will be kept. The default is not to restrict the age of files.--max-size=MAXBYTESβ Download only files up toMAXBYTESlength. Locally existing copies of overlong files will be deleted during the clean-up step. The default is not to restrict the file size. This option was added in version0.5.1.-x,--exclude=WILDCARDβ Exclude paths matchingWILDCARD. IfWILDCARDmatches the full path of the remote file then the file will not be downloaded.WILDCARDis a shell style wildcard expression, not a regular expression like those ofgrep. You can repeat this option as often as you want, and you can intermix it with the--includeoption. If both includes and excludes are used then the last matching one will be honored. The list starts with an implicit--include *. If the--toloweroption is used together with--excludeor--includethen the in/exclude patterns have to be written in lower case. This option was added in version0.3.0.-i,--include=WILDCARDβ Include paths matchingWILDCARD. This is the opposite of the--excludeoption. It was added in version0.3.0.-X,--in-exclude-file=FILEβ Read in/exclude patterns fromFILE. The include and exclude patterns are read from a file. If the first character of a line is a+the remainder of the line is treated as an argument of a--includeoptiona and if it is a-it is treated as an argument to a--excludeoption. Lines starting with a#are ignored.FILEwill be read after any--includeand--excludeoptions given on the command line have been read. This option was added in version0.6.6.--ignore-sizeβ Ignore file size. Do not compare file sizes when checking the remote file has to be downloaded. This option was added in version0.4.4.--ignore-timeβ Ignore modification times. Do not compare file modification times when checking the remote file has to be downloaded. This option may be combined with--ignore-size, in which case a file will never be downloaded regardless of changes in file size or modification time. In other words:ftpcopywill not download any updates. π yeah. she said that. This option was added in version0.4.4.--max-depth=ARGβ Descend at mostLEVELdirectories.0meansdo not enter sub directories at all,1meansenter sub-directories, but not their sub-directories.
The default is 2^32-1 meaning enter all.
π₯ Deletion options:
-n,--no-deleteβ Do not delete files. This influences the cleanup step when getting rid of things the server doesn't have anymore. It does not stopftpcopyfrom deleting files when it detects something in it's way during a download. so like, she'll still move things out of her way. she's not being rude, she's just efficient.-M,--max-deletes=COUNTβ Do not delete more thenCOUNTfiles. This option may be useful to limit the impact of a tempoary loss of files on the server. This only influences the cleanup step and does not stopftpcopyto delete files in it's way during a download. The default is0, meaning unlimited. This option was added in version0.4.5.
β Operational options:
-d,--directories-onlyβ Only create the directory hierarchie. Do not download files. Any file in the tree will be deleted unless the-noption is also given. This option will be removed in future versions, unless someone objects. π«Ά speak now or forever hold your peace.--dry-runβ Don't do anything.ftpcopywill only show what would be done. This option was added in version0.3.6.-T,--timeout=SECONDSβ Timeout to use for network read/write. The default is30seconds and is usually sufficient. This option was added in version0.3.8.--rate-limit=BYTES_PER_SECONDβ Limit file download speed. Limit the transfer rate of file downloads to about that many bytes per seconds. The implementation is crude and simple, by sleeping up to one second between network reads, and therefore does not even try to limit the rate exactly to that number. On the other hand it usually works and is unlikely to break things by causing timeouts. The default is unlimited. This option was added in version0.4.7.--interactiveβ Read directories from stdin. This option tellsftpcopyto ignore any directories given on the command line, and to read commands from the standard input. Each command consists of two lines, the first being a directory on the remote server, and the second a local directory.ftpcopywill print anEND-OF-COPYline after each operation. This option was added in version0.3.6and will be removed in future versions, unless someone objects. π again with the objections. say something or it's gone.
π§ Workaround options:
--ascii-listingsβ Do directory listings in ASCII mode. Use this option if the FTP server is unable to correctly list directories in binary mode, for example, if you see a message like this (usually on one line):
fatal: received unwanted answer to LIST: 426 Data connection: Illegal seek.
This option was added in version 0.5.2.
-L,--list-options=OPTSβ AddOPTStoLISTcommand. This allows to pass arbitrary options to the FTP serversLISTcommand. Note thatftpcopydoes not cope well with recursive directory listings. This option was added in version0.3.0.-s,--symlink-hackβ Deal with symbolic links. This is only useful to mirror sites which create listings through/bin/ls, and will fail if a file name in a link contains a->sequence. so like, if your filenames are out here looking like arrows, this one's not for you bestie.--force-selectβ Useselect, notpoll. Do not use thepoll()system call even if it's available, but useselect()instead. This allows the program to be used together with runsocks from the socks5 reference implementation. Please note that you will need a directly reachable name server anyway, as the DNS library in use does not support SOCKS (you can always use IP addresses). This option was added in version0.3.8.--mdtmβ bestie, this one tells ftpcopy to use theMDTMcommand to grab the remote time. π By default, ftpcopy takes the times from the directory listings. But that doesn't work if the server implements an inferior listing format (most do, no cap) and doesn't send time stamps in universal coordinated time (UTC). The damage from that is limited to file time stamps being wrong by a few hours. This option makes ftpcopy send aMDTMcommand for any file it might want to download. The drawback? It eats performance: ftpcopy usually sends just one command for a complete directory it traverses. With--mdtmit has to send an additional command for any file. π This option was added in version0.3.10.--allow-pasv-ip=IP4β allows data connections to the addressIP4. Normallyftplsonly accepts data connections to the IP addresses it received as an answer to the DNS request, or the IP address in the URL. Sometimes this is not enough, especially when NAT or masquerading are active. ftpcopy then prints an error messageillegal redirect by FTP server. With this option, which may be given more than once, you can add additional addresses to the internal list of allowed data connection targets.IP4has to be an IPv4 address or a list of IPv4 addresses, separated by commas. The environment variableFTPCOPY_ALLOW_PASV_IPserves the same purpose. β οΈ Note: Do not use this option without thinking: FTP redirects may be used to launch denial of service attacks against innocent targets. This option was added in version0.6.1.--no-resumeβ do not try to resume downloads. TheRESTcommand, needed to resume a failed download, is badly specified and likely to be misinterpreted and -implemented. Use this option in case of trouble. π οΈ This option was added in version0.6.0.--tolowerβ changes all local file names to lowercase. Use this only if you are absolutely sure that the remote side does not contain any files or directories whose lower cased names collide with each other. Otherwise this option will waste bandwidth. π« If this option is used together with the--excludeor--includeoptions, then the in/exclude patterns have to be written in lower case. This option was added in version0.3.8.
β¨ Help options β¨
--include-exclude-helpβ how--includeand--excludework.--examplesβ show usage examples.--see-alsoβ where to find related information.--versionβ show version:ftpcopy (ftpcopy) 0.6.7.--helpβ show a list of options or the long help on one. The use with an argument shows the long help text of that option; without an argument it will list all options.--longhelpβ show longer help texts for all or one option.
β¨ EXAMPLES β¨
mirror cr.yp.to:
ftpcopy \
--exclude '*.cdb' \
--exclude '*software/precompiled*' \
cr.yp.to / /private/file/0/mirror/cr.yp.to
This means:
- i'm not interested in
.cdbfiles. - precompiled stuff is also not downloaded.
- the host to connect to is
cr.yp.to. - the remote directory is
/, and - and
/private/file/0/mirror/cr.yp.tois the local directory.
πΈ IN/EXCLUDE πΈ
In- and exclude lists are internally mixed together, keeping the order in which they were given. The list starts with an implicit include *. ftpcopy honors the last match.
The wildcard matching is done against the full remote path of the file. The / character has no special meaning for the matching and is treated like any other.
Note: you have to include top level directories of files or directories you want to include. Something like this will NOT work:
--exclude '*' --include '/w/h/e/r/e/file.c'
You need to include /w, /w/h and so on.
π COPYRIGHT π
Copyright (C) 2003 Uwe Ohse.
The software comes with NO WARRANTY, to the extent permitted by law.
This package is published unter the terms of the GNU General Public License version 2. Later versions of the GPL may or may not apply, see http://www.ohse.de/uwe/licenses/
π AUTHOR π
Uwe Ohse, <uwe@ohse.de>.
π¦ MORE INFORMATION π¦
Please report bugs to <ftpcopy@lists.ohse.de>
π SEE ALSO π
ftpls(1) lists ftp directories. ftpcp(1) is a frontend for ftpcopy.
The ftpcopy package has a mailing list. Send an empty mail to <ftpcopy-subscribe@lists.ohse.de> to subscribe to it.
The ftpcopy homepage is at
http://www.ohse.de/uwe/ftpcopy.html
That's the whole ftpcopy(1) page, bestie! Dated 2005-04-28. Now go mirror something cute. πβ¨
π¦ where this page comes from
- debian bookworm: ftpcopy 0.6.7-5
- debian trixie: ftpcopy 0.6.7-7 Β· GPL-2.0-only
- ubuntu jammy: ftpcopy 0.6.7-5
- ubuntu noble: ftpcopy 0.6.7-6
- ubuntu questing: ftpcopy 0.6.7-7
- ubuntu resolute: ftpcopy 0.6.7-9 Β· GPL-2.0-only
- ubuntu stonking: ftpcopy 0.6.7-9 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms