.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "FTP-UPLOAD 1p" .TH FTP-UPLOAD 1p "2022-11-21" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" ftp\-upload \- batch transfer local files to an FTP server .SH "SYNOPSIS" .IX Header "SYNOPSIS" \&\fBftp-upload\fR [\fIany-switch\fR]... {[\fIrepeatable-switch\fR]... \fIfile\fR...}... .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\fBftp-upload\fR is used to send local files to an \s-1FTP\s0 server. It isn't interactive, it's meant to be used from scripts. It is disciplined about its exit value and it doesn't output informational messages by default. .PP There are two kinds of switches. Initial switches have to appear before any filenames, they affect the session as a whole. Repeatable switches can appear interspersed with the file names, they affect the transfer of the files which appear after them on the command line. .SH "OPTIONS" .IX Header "OPTIONS" .SS "Initial switches" .IX Subsection "Initial switches" These have to be used before any file names listed on the command line. .IP "\fB\-\-debug\fR" 4 .IX Item "--debug" Turn debugging on. .IP "\fB\-\-help\fR" 4 .IX Item "--help" Show the usage message and die. .IP "\fB\-\-ignore\-quit\-failure\fR" 4 .IX Item "--ignore-quit-failure" Don't complain or set a failure exit code just because the \s-1QUIT\s0 command fails. This can be necessary because some servers, in blatant disregard of \s-1RFC 959,\s0 close the command channel when you send them an \s-1ABOR\s0 command. .IP "\fB\-v\fR, \fB\-\-verbose\fR" 4 .IX Item "-v, --verbose" Print informational messages to stdout. .IP "\fB\-\-version\fR" 4 .IX Item "--version" Show the version number and exit. .SS "Initial switches which specify connection information" .IX Subsection "Initial switches which specify connection information" These also have to be used before any file names listed on the command line. They specify the information used to set up the \s-1FTP\s0 connection. .IP "\fB\-\-account\fR \fIaccount\fR" 4 .IX Item "--account account" This specifies the account to be used when logging into the remote system. This is distinct from the user name used to log in. Few systems need this. There is no default. .IP "\fB\-h\fR, \fB\-\-host\fR \fIhost\fR" 4 .IX Item "-h, --host host" Specify the host to which to connect. There is no default, you have to specify this switch. .IP "\fB\-\-passive\fR" 4 .IX Item "--passive" Force the use of passive (\s-1PASV\s0) transfers. Passive transfers are required with some firewall configurations, but if you have such you'd do better to configure Net::FTP so that it knows when to use them (see Net::Config). If you need to use passive transfers with certain (broken) servers, however, this switch is your best bet. Alternatively, you can set \f(CW$FTP_PASSIVE\fR to 1 in the environment (see Net::FTP). .IP "\fB\-\-no\-passive\fR" 4 .IX Item "--no-passive" Force the use of active mode transfers. Active mode is the default so this is only required if your Net::Config or \f(CW$FTP_PASSIVE\fR turn passive mode on. .IP "\fB\-\-password\fR \fIpw\fR" 4 .IX Item "--password pw" This gives the password which will be used to login. The default is your email address. .Sp Note that you should not specify a real (secret) password this way, as on most systems anybody on the machine can see the arguments you pass to your commands. Use one of other password-setting switches instead. .IP "\fB\-s\fR, \fB\-\-password\-stdin\fR" 4 .IX Item "-s, --password-stdin" This tells \fBftp-upload\fR to read the password from standard input. No prompt will be printed, and a single line will be read. Most people will use this switch to specify the password. Eg, .Sp .Vb 1 \& echo 3x9sjJJh | ftp\-upload \-sh $host \-u $user $file .Ve .Sp Using echo this way is safe where the \fB\-\-password\fR switch isn't if the echo command is built in to the shell. .IP "\fB\-\-password\-fd\fR \fIfd\fR" 4 .IX Item "--password-fd fd" This is like \fB\-\-password\-stdin\fR except that it reads the password from the file descriptor numbered \fIfd\fR. .Sp .Vb 1 \& ftp\-upload \-h $host \-u $user \-\-password\-fd=3 3<$pw_file $file .Ve .IP "\fB\-u\fR, \fB\-\-user\fR \fIuser\fR" 4 .IX Item "-u, --user user" Specify the user name to use when logging in. The default is \f(CW\*(C`anonymous\*(C'\fR. .SS "Repeatable switches" .IX Subsection "Repeatable switches" These switches can be used anywhere on the command line (except after the last file name). They affect the transfer of files listed after them. .IP "\fB\-\-as\fR \fIremote-name\fR" 4 .IX Item "--as remote-name" Normally a file is transferred using the same name it has locally. If you use this switch the next file transferred will be called \fIremote-name\fR on the other host instead. .Sp .Vb 1 \& ftp\-upload \-\-host $host \-\-as index.htm index.html .Ve .IP "\fB\-a\fR, \fB\-\-ascii\fR" 4 .IX Item "-a, --ascii" Perform transfers in \s-1ASCII\s0 mode. .IP "\fB\-b\fR, \fB\-\-binary\fR" 4 .IX Item "-b, --binary" Perform transfers in binary mode. This is the default. .IP "\fB\-d\fR, \fB\-\-dir\fR \fIdir\fR" 4 .IX Item "-d, --dir dir" Change directory to \fIdir\fR on the \s-1FTP\s0 server before continuing. You can use this multiple times between files, \fBftp-upload\fR will chdir once for each time you specify it. Using \f(CW\*(C`..\*(C'\fR as the \fIdir\fR will cause an \s-1FTP\s0 \&\f(CW\*(C`CDUP\*(C'\fR to be done rather than a \f(CW\*(C`CWD\*(C'\fR. .IP "\fB\-\-full\-path\fR" 4 .IX Item "--full-path" Normally uploaded files go into the current directory on the remote host, even when the local file name given contains slashes. Eg, if you say .Sp .Vb 1 \& ftp\-upload \-h $host /etc/motd .Ve .Sp \&\fBftp-upload\fR will upload the file as \fImotd\fR, not \fI/etc/motd\fR. This differs from how the standard \fBftp\fR program works, and it also differs with how \fBftp-upload\fR worked before version 1.3. .Sp If you specify \fB\-\-full\-path\fR, you'll get the other behavior. A request to upload \fIdir/file\fR will tell the server to store \fIdir/file\fR rather than \fIfile\fR. .Sp When you use \fB\-\-as\fR the \fB\-\-full\-path\fR setting doesn't matter. \&\fB\-\-full\-path\fR only tells the program what name to use when it's choosing the name. .IP "\fB\-\-no\-full\-path\fR" 4 .IX Item "--no-full-path" Disable \fB\-\-full\-path\fR. This is the default. .IP "\fB\-l\fR, \fB\-\-ls\fR" 4 .IX Item "-l, --ls" Try to get a remote directory listing of files after transferring them. I say \*(L"try\*(R" because there's no guaranteed way to do this with the \s-1FTP\s0 protocol. The command I run is \f(CW\*(C`LIST \f(CIfile\f(CW\*(C'\fR. This will generally work if \fIfile\fR doesn't contain any special characters. .IP "\fB\-L\fR, \fB\-\-no\-ls\fR" 4 .IX Item "-L, --no-ls" Disable the \fB\-\-ls\fR behavior. .IP "\fB\-\-tmp\-none\fR" 4 .IX Item "--tmp-none" Transfer files directly, don't do anything special to try to ensure that they don't appear under their real names on the remote machine until the transfer is finished. Each file is transferred with a single simple \&\f(CW\*(C`STOR\*(C'\fR. This is the default. .IP "\fB\-\-tmp\-samedir\fR" 4 .IX Item "--tmp-samedir" Transfer files to the remote machine using a temporary name, then rename them when the transfer finishes. This won't work if the remote server doesn't give a recognizable response to the \f(CW\*(C`STOU\*(C'\fR command. .Sp If the server's response to \f(CW\*(C`STOU\*(C'\fR isn't recognized by Net::FTP but is reasonable, Graham Barr might be willing to change Net::FTP to recognize it. If you like you can send the \f(CW\*(C`\-\-debug\*(C'\fR output to me and I'll coordinate such requests. .IP "\fB\-\-tmp\-dir\fR \fIdir\fR" 4 .IX Item "--tmp-dir dir" Transfer files to \fIdir\fR on the remote host, then rename them when the transfer is complete. This is safer than \fB\-\-tmp\-samedir\fR because it doesn't use \f(CW\*(C`STOU\*(C'\fR and so it works with more servers. .Sp .Vb 1 \& ftp\-upload \-h $host \-\-tmp\-dir incoming $file .Ve .IP "\fB\-\-tmp\-format\fR \fIfmt\fR" 4 .IX Item "--tmp-format fmt" Transfer files to \f(CW\*(C`sprintf(\f(CIfmt\f(CW, \f(CIfile base name\f(CW)\*(C'\fR, then rename them when the transfer is complete. Like \fB\-\-tmp\-dir\fR, this is safer than \fB\-\-tmp\-samedir\fR because it doesn't use \f(CW\*(C`STOU\*(C'\fR and so it works with more servers. .Sp .Vb 1 \& ftp\-upload \-h $host \-\-tmp\-format tmp.%s $file .Ve .SH "AUTHOR" .IX Header "AUTHOR" Roderick Schertler