wput(1)

πŸŽ€ NAME πŸŽ€

okay bestie, this is the wput(1) page, filed under Internet Applications - FTP, and it's genuinely so useful, i'm obsessed.

wput β€” a wget-like ftp-uploader ✨


🌸 SYNOPSIS 🌸

wput [options] file [file ...] URL

πŸ¦‹ DESCRIPTION πŸ¦‹

Wput is a free utility and its whole entire job is uploading files to a ftp-server. that's it. that's the gig. πŸ’…

Wput is non-interactive and background-capable. it can upload files or whole directories, and it's built to be a robust client even when your connection is being unstable and messy β€” so if the connection broke, it will retry to upload a file. resilience queen fr fr. πŸ’ͺ

Wput supports resuming, meaning it automatically continues uploading from the point where the previous upload stopped. which means you can kill Wput anytime and it will β€” if the remote ftp-server supports this, which is most likely the case β€” finish the partial uploaded file. no cap, you can just yolo-kill it. πŸ”₯

Wput supports connections through proxies, letting you use it in an environment that can only reach the internet via a proxy, or to provide anonymity by hiding your ip-address from the server. and for SOCKSv5-proxies, Wput also supports listening mode β€” that lets you use port-mode ftp through a proxy, which is lowkey essential if the remote ftp is behind a firewall or a gateway. 🧚

Wput supports timestamping, so (in the ideal case, and if timestamping is enabled) it will only upload files that are newer than the remote-file. main character energy: only showing up when it actually needs to. ✨

the upload-rate of Wput can be restricted, so that Wput won't eat all available bandwidth. considerate icon behaviour. 🫢

✨ URL-Input-Handling ✨

URLs are recognized by the ftp://-prefix. πŸ¦‹

Wput first reads the URLs from command-line, and associates the first file with the first URL, the second file with the second URL, etc. then it transmits the file/URL combinations that are already complete. after that, Wput uses the --input-file (if any) and reads the URLs using the same sheme as above. in situations where more URLs than files are specified, Wput tries to guess the local filename from the URL. in case there are more files than URLs remaining, Wput uses the last known URL for each of the files. πŸ‘‘

so you can specify e.g. one URL and read all filenames from a file. or use wput *.txt ftp://host, to transfer all *.txt-files. see doc/USAGE.examples for further examples. πŸ“š

to be on the safe side, it is recommended to supply the files before the URLs.

πŸ’« Guessing Local File πŸ’«

if Wput has an URL without a corresponding filename, Wput tries to guess the local file's location. e.g. using wput ftp://host/directory/path/file, Wput will look out for /directory/path/file. if not found, Wput looks for ./directory/path/file, ./path/file and ./file. detective mode activated πŸ”βœ¨


πŸ’… OPTIONS πŸ’…

πŸ“ Logging and Input File Options πŸ“

  • -a logfile, --append-output=logfile β€” append all logged messages to logfile. πŸ“
  • --basename=path β€” this option causes Wput to snip path from all input-files when they are connected to the URL. wput /usr/share/doc.tgz ftp://host/ would create ftp://host//usr/share/doc.tgz, whereas specifying /usr/share/ as basename will result in ftp://host/doc.tgz being created. βœ‚οΈ
  • -i file, --input-file=file β€” reads URLs and filenames from file. if there are URLs on the command-line too, these will be retrieved first, unless sorting is enabled. see also the URL-Input-Handling section. if file is -, the URLs will be read from stdin. if you want to pipe the contents of the file that shall be uploaded to stdin, this cannot be done (yet). but you can use the --input-pipe flag and read the contents a) from a named pipe β€” -I "cat named.pipe; echo > /dev/null" β€” or b) directly from the command, that outputs the data. (see --input-pipe) 🚰
do not do things like find | wput ftp://host/ -i -! Wput would upload all files from the current directory (since the first output of find will be '.') and afterwards each file again (since find postes its name to Wput. and further problematic is that Wput will upload each directory that is given by find and since find itself recurses all directories, the files would be uploaded three times (or even more often for further subdirectories). use wput ftp://host/ to upload everything from the local directory. or use find ! -type d | wput ftp://host/ -i - to tell find not to output directories. πŸ’€
  • -I command, --input-pipe=command β€” if no file/directory can be "guessed" (see "Guessing Local File") from the URL, the output of command is taken as file-input. command is invoked as follows:
command ftp "username" "ip/hostname" port
"remote_directory" "remote_filename"

the hostname is only supplied if the ip cannot be resolved. if you do not want these parameters to confuse the program from which you read the contents, use something like -I "cat file; echo > /dev/null" so that these parameters are passed to echo and to /dev/null afterwards. since the progressbar is not capable of handling unknown filesizes, the filesize is set to 1 GiB. therefore the ETA shows a wrong value. 😭

  • -nv, --less-verbose β€” be less verbose. that means reducing Wput's output to a minimum. specifying this flag more often is equal to the --quiet flag. some people also like combining the -v and -nv flags, being quite senseless. 🀷
  • -o logfile, --output-file=logfile β€” log all messages to logfile. πŸ“‹
  • -q, --quiet β€” turn off Wput's output. 🀫
  • -R, --remove-source-files β€” unlinks/deletes files that have been successfully transmitted. bye bye source files πŸ‘‹
  • -s, --sort β€” if sorting is enabled, Wput first reads all URLs from any input-devices available and will sort them before transmitting each file.

the sorting order is: ip/hostname, port, username, password, directory, filename. sorting requires a bit more memory since all data needs to be held there. 🧠

  • -v, --verbose β€” turn on verbose output. this gives some more information about what Wput does. if you specify this flag twice, you get debug output. πŸ”

πŸ”₯ Upload Options πŸ”₯

  • -A, --ascii β€” Wput automatically determines which transfer-format to use, by looking at the file-extensions. certain files are recognized as ASCII. these are: txt, c, java, cpp, sh, f, f90, f77, f95, bas, pro, csh, ksh, conf, htm, html, php, pl, cgi, ing, js, asp, bat, cfm, css, dhtml, diz, h, hpp, ini, mak, nfo, shtml, shtm, tcl, pas

specifying this flag forces Wput to use ASCII mode file transfers. πŸ”€

  • -b, --background β€” go to background immediately after startup. if no output file is given, wput will redirect its output to "./wputlog" πŸŒ™
  • -B, --binary β€” specifying this flag forces Wput to use BINARY mode file transfers. πŸ”’
  • --bind-address=address β€” when making client TCP/IP connections, bind() to address to address on the local machine. address may br specified as a hostname or IP address. this option can be useful if your machine is bound to multiple IPs. πŸ“
  • --force-tls β€” if this flag is specified and Wput is linked with the OpenSSL-library, the flag enforces the usage of TLS: if no TLS-connection can be established the process will cancel and not try to go on with an unencrypted connection. πŸ”’

⭐ Basic Startup Options ⭐

  • -l rate, --limit-rate=rate β€” if you don't want Wput to eat up all available bandwidth, specify this flag. rate is a numeric value. the units 'K' (for KiB) and 'M' (for MiB) are understood.

the upload rate is limited on average, meaning that if you limit the rate to 10K and Wput was just able to send with 5K for the first seconds, it will send (if possible) afterwards more than 10K until the average rate of 10K is fulfilled. 🚦

  • -m, --chmod β€” this will change the access mode of the transferred files. the format is the three-digit octal unix mode, e.g. 644 means rw-r--r--. πŸ”
  • -nc, --dont-continue β€” if this flag is specified, resuming will be turned off, meaning that a remote file being smaller than the local one will be overwritten. to skip this file, you have to enable --skip-existing.

see also doc/USAGE.resumehandling πŸ“–

  • -N, --timestamping β€” if timestamping is enabled, Wput will retrieve a directory list and parse it to determine the remote file-date. if the local file is newer than the remote one (there is a default allowed timevariance of 5 seconds, which can be adjusted in the wputrc-file) it is uploaded, otherwise skipped.

the local date is dermined by the mtime (time of last modification), using the current time-zone. this should be equal to the output of ls -l. πŸ•°οΈ

since you usually do not want to resume existing files, you should employ the --reupload --dont-continue flags as well.

  • -p, --port-mode β€” per default, Wput uses passive mode ftp, which works well for most configurations. if passive mode fails, Wput automatically falls back to port mode.

if you want Wput to start using port mode ftp, specify this flag. πŸ”Œ

  • --proxy=mode β€” alias is option -Y. the mode can be either http for http-based proxies (such as SQUID), socks for SOCKSv5 proxies or off to disable the proxy. 🌐
  • --proxy-user=name β€” if the proxy-server requires authentication, use NAME as user-name. you need to specify --proxy-pass too. these information can also be stored in the wputrc-file. πŸ™‹
  • --proxy-pass=password β€” specifies the password to use for the proxy. 🀫

🌈 FTP Options 🌈

  • --no-directories β€” if Wput is unable to CWD into a directory, it will try to create it. if this is not the desired behaviour, specify this flag to force Wput not to create any directories. πŸš«πŸ“
  • -t number, --tries=number β€” set number of retries to number. specify -1 for infinite retrying, which is default, too. πŸ”
  • -u, --reupload β€” if this flag is specified, a remote file having the same size as the local one is to be uploaded. skipping is default. ⬆️
  • --skip-larger β€” if this flag is specified, a remote file being larger than the local one will be skipped. default is reuploading it. πŸ™ˆ
  • --skip-existing β€” if this flag is specified, the upload of a file will be skipped if the remote file already exists. ⏭️

πŸ‘‘ General options πŸ‘‘

  • -V, --version β€” display the version of wput. πŸ’–
  • -h, --help β€” print a help screen, with a short description of wput's command-line options. πŸ†˜

πŸ’– DIAGNOSTICS πŸ’–

okay bestie, let's talk about what wput tells you when it's done β€” the exit status, aka its little mood ring. 🫢

  • 0 β€” everything's giving immaculate ✨ either it all went fine, or there was literally nothing to do in the first place. either way, we're chilling.
  • 1 β€” some files got skipped during the upload. this happens because of timestamping or resume-rules, yk how it is. not a disaster, just a lil "we passed on those ones" energy.
  • 2 β€” some files failed to be transmitted because of a remote error. 😭 the other end said no.
  • 3 β€” the double whammy: some files failed AND some others were skipped. combo deal, no thank you.
  • 4 β€” this one's for general problems, like when some system-functions just fail on you. it's giving "not my fault, the system is being weird." πŸ’€

πŸ› BUGS πŸ›

pls pls pls β€” you are so welcome to send bug reports and suggestions about Wput through the Sourceforge Bugtracking System, here:

http://sourceforge.net/tracker/?group_id=141519

and when you do, bestie, send all the available information that might concern this bug. like, all of it. for example: your Operating System, and what can be done to reproduce the error. 🧚

also supply the debug-output too β€” that helps a lot when analysing the problem. (just remove any confidential data if there is any, obviously. πŸ™ˆ protect urself.)

and if you use a wputrc file, it might also be useful to provide the relevant parts of it. receipts, basically. πŸ’…

now, if there's a crash due to a segfault or similar, try to run it in a debugger, like this:

gdb /usr/bin/wput core

and type where to get the backtrace. πŸ‘‘

it would also be a great help if you could recompile wput with memory-debugging support, like:

make clean; make memdbg; [make install]

and use this debug-dump. seriously, iconic of you. 🌸


πŸ‘€ SEE ALSO πŸ‘€

many options can be set in a wputrc file β€” for its documentation, consult the sample file provided by Wput. πŸ“„

there are also some USAGE.* files in the doc/ directory of Wput. these contain further information and samples on how to use Wput. go read them, they ate. πŸ”₯


πŸ‘‘ AUTHOR πŸ‘‘

Wput is written by Hagen Fritsch <fritsch+wput-man@in.tum.de>


and that's the whole page, bestie! this was wput(1), version 0.6.2 β€” go off and upload ur files, main character. πŸ’œπŸ¦‹βœ¨