ftpq(1)

NAME
ftpq - queue up ftp send (upload) requests for batch processing on dial-up

SYNOPSIS
ftpq add [-c config] -h host [-P port] -u login [-p password] [-a account] [-d remotedir] [-f remotefile] [-s] localfile [...]

ftpq delete all | jobid [jobid ...]

ftpq list

ftpq run [-v]

ftpq help

DESCRIPTION
ftpq has four modes of operation: add, delete, list and run. In add mode, it stores ftp requests in a queue for batch processing. In delete mode, it allows the user to delete jobs from the queue prior to processing. In list mode, it prints out jobs currently in the queue. In run mode, it steps through the jobs in the queue and attempts to send them to the specified host.

The intention is that ftpq is run in add/delete/list mode by normal users, and in run mode as the super-user on successful dial-up connection to the outside world, in the same way as sendmail(8) is typically configured to run. Files will only be sent if the creator of the job file in the spool directory matches the owner of the file to be sent.

If ftpq encounters problems in sending a particular job, it will mail the originating user to inform them of the nature of the problem.

OPTIONS (ADD MODE)

-c config
    Read host, port, user, account, password and remote directory details from the config section of ~/.ftpqrc. Options duplicated on the command line take precedence.

-h host
    Specify the host to which the file is to be uploaded. This must be provided, either on the command line or in ~/.ftpqrc. host may take the form of a host name or an IP address.

-P port
    Specify the host port for connection. If not provided, the default FTP port of 21 is used. Note: this is an uppercase P.

-u login
    This is the server login ID, and must be provided either on the command line or in the config file.

-p password
    This is the server login password, and is optional. You should supply whatever combination of password and account you would use when connecting manually.

-a account
    You can specify an optional account name here.

-d remotedir
    remotedir is the absolute path on the server to the location where the file is to be uploaded, referenced from the root of the server. This is not necessarily the same as the user's home directory: log in manually and try "cd /". If omitted, the root directory is assumed.

-f remotefile
    The file will be named remotefile on the server. If this is not specified, the file will be given the same name as localfile. This may not be specified if multiple local files are specified, whether explicitly with multiple filenames or implicitly with wildcards.

-s  If -s (snapshot) is specified, ftpq will make a copy of localfile in the spool directory, and will send that "snapshot" version when next invoked in run mode.

OPTIONS (DELETE MODE)
In delete mode, a list of one or more job ID numbers may be supplied, corresponding to the job IDs shown in list mode. ftpq will attempt to delete each in turn, printing a message reporting success or failure for each job. Alternatively, the special keyword all may be supplied, in which case ftpq will attempt to delete all open job files.

OPTIONS (RUN MODE)

-v  Verbose. FTP and SMTP transmissions are copied to stdout for debugging purposes.

FILES
/var/spool/ftpq
    Spool directory for jobs.
~/.ftpqrc
    Configuration file in which the command line parameters for frequently-used runs may be stored. Format is the section name in square brackets, followed by the command line switches and their values on a separate line for each. Any of the options available on the command line may be specified here. If a switch appears more than once in a section, the first value is used.

  Example config file

An example config file is:
    [MyWeb]
    -h my.web.server
    -u my.login
    -p my.password
    [WorkFTP]
    -h my.work.server
    -u work.login
    -p work.password
    -d /my/work/dir

You can then run:
    ftpq add -c MyWeb index.html
    ftpq add -c MyWeb -d images *.png
    ftpq add -c WorkFTP *.dat

Command line options take precedence, irrespective of order. Directory parameters do NOT combine, so:
    ftpq add -c WorkFTP -d data file.dat

is probably not what you want, which is:
    ftpq add -c WorkFTP -d /my/work/dir/data file.dat

If you specify a local file which includes a path component, ftpq will simply append this whole filename onto whatever it is using as the remote directory. Use the -f switch to prevent this. Example:
    ftpq add -c MyWeb -d html -f 1.html web/1.html

will store ./web/1.html as /html/1.html on the server described in the [MyWeb] section of .ftpqrc. Without the -f switch, the file would end up as /html/web/1.html.

DIAGNOSTICS

0 (OK)
    Program exited normally.

1 (AB_NOFILE)
    A required file could not be read or written.

2 (AB_NOPERM)
    Permission denied to read or write a file.

3 (AB_FILEERR)
    Unspecified file error.

4 (AB_MALLOC)
    Unable to allocate memory.

5 (AB_CASEERR)
    Internal state machine error (this never happens!).

6 (AB_NOSPOOL)
    Cannot access or find spool directory.

7 (AB_ARGERR)
    Command line arguments invalid.

BUGS
Probably many. Let me know.

COPYRIGHT
Copyright © 2000, 2001 Mark Tranchant

ftpq is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.

ftpq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with ftpq; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

SEE ALSO

weex
    and quftp perform similar functions to ftpq.

http://www.tranchant.freeserve.co.uk/ftpq.html
    - ftpq home page.

AUTHOR
Mark Tranchant <mark@tranchant.freeserve.co.uk>