Node:Reference, Next:The changebase Source Code, Previous:A Trivial Example, Up:Top
WebPublish transfers a local copy of a website to a remote FTP server using an account. An account contains the information that WebPublish uses to transfer a website to an FTP server.
Usage: webpublish COMMAND [[DATA]...] [[FLAG]...] [[FILE]...]
COMMAND is always required on the command line (except when the -help, and/or -version, FLAG is included). Only one COMMAND can be included on each command line. The COMMAND tells WebPublish what to do. The valid COMMANDs are:
--publish
--synchronize
--add
--change
--remove
--list
DATA command line options specify the information that WebPublish needs to perform the requested COMMAND. Most COMMANDs require more than one DATA option to be included on the command line. Each DATA option requires an argument. The DATA options are:
-a or --account ACCT
-w or --website DIR
-s or --server FTP
-u or --user USER
-p or --password PASS
-d or --directory DIR
-e or --extension EXT
-p or --path PATH
-D or --depth NUM
-F or -file FILE
account
, shell
, synch
, publish
, or mode
(case is not
compared).
The WebPublish FLAGs modify the behavior of WebPublish. Multiple FLAGs are allowed on the same command line. The valid FLAGs are:
-h or --help
-v or --version
-V or --verbose
-f or --force
--prompt
Specific FILEs can be published by listing each file on the command line. The file path can be a full path or a relative path. Wildcards can be used with a full path.
The following example will create a new account called example
.
The account will publish the website that is located at
/home/mydir/example
to the ftp server <ftp.example.com
>.
webpublish --add -F account -a example -s ftp.example.com -u testguy -p testpass -w /home/mydir/example
The following example will publish the account example
.
webpublish --publish -a example -V
This command line switch will cause WebPublish to write a help message to stdout. The help message will include a brief description of each WebPublish command line option.
This command line switch will cause WebPublish to write a brief version message to stdout.
This command line switch will cause WebPublish to write a lot of descriptive messages to stdout. The messages will describe what WebPublish is doing, as WebPublish does it.
This command line switch will cause WebPublish to transfer all selected files. Normally, WebPublish will only transfer the selected files that do not already exist on the server or that have a file modification date on the server that is older than the local copy of the file.
This command line switch will cause WebPublish to prompt the user
before WebPublish removes a file or directory from the
server. When the user is prompted, the user will be given the choice of
answering y for yes
, n for no
, or a for add
. If the user
answers y then the file or directory will be removed from the
server. If the user answers n then the file or directory will not
be removed from the server. If the user answers a then the file
or directory will not be removed from the server and the path for
the file or directory will be added to the synch
database file.
This will cause WebPublish to exclude the file or directory from
being synchronized in the future.
This is the command line option that is to be used when you must
include an account name. An account name is required by most
WebPublish command line actions. Some examples of an account name
are:
-a personal
-a business
-a photowebsite
This is the command line option to use when you must specify a website
on the command line. The value for this variable
must be the complete path to the local directory that contains the
website. An example website is:
-w /home/mydir/mywebsite
This is the command line option that is to be used when you must specify
the name of an FTP server on the command line. The value for this variable
must be the name of the FTP server. Some example server names are:
-s localhost.localdomain
-s ftp.tripod.com
-s ftp.padresoftware.com
This is the command line option that is to be used when you must specify
the name to use when logging into the FTP server. Some example user names
are:
-u weedguy
-u charles
-u bigstud
This is the command line option that is to be used when you must specify
the password to use when logging into the FTP server. Some example passwords
are:
-p f9f012j2
-p frogman
-p bigstud
This is the command line option that is to be used when you must specify a
directory on the command line. If a directory path begins with /
then the
path is assumed to be a full path. Otherwise, the path is assumed to be
relative to the base directory of the website. Either the base address of
the local copy of the website, or the base address of the website on the
server.
Some example directories are:
-d /home/mydir/mywebsite
-d cgi-bin
-d photos/party
This is the command line option that is to be used when you must specify
a file extension on the command line. Some example file extensions are:
-e html
-e ram
-e jpg
This is the command line option that is to be used when you must specify
a complete path to a file or to a directory. If a path begins with /
then
the path is assumed to be a full path. Otherwise, the path is assumed to be
relative to the base directory of the website. Either the base address of
the local copy of the website, or the base address of the website on the
server. Some example paths are:
-P /home/mydir/mywebsite/index.html
-P cgi-bin
-P index.html
This is the command line option that is to be used when you must specify
the maximum number of directory levels to traverse when publishing or
synchronizing a website. Some example directory levels are:
-D 1
-D 2
-D 5
This is the command line option that is to be used when you must
specify a database file to operate on. The value of -F can be
either account
, shell
, synch
, publish
, or mode
. Here is
an example that will add a record to the mode database file.
webpublish -add -F mode -e html -m text
This is the command line option that is to be used when you must
add a record to a WebPublish database file. The -F DATA option
determines which file will be operated on. The value of -F can be
either account
, shell
, synch
, publish
, or mode
. Here is an example
that will add a record to the mode
database file.
webpublish --add -F mode -e html -m text
This is the command line option that is to be used when you must
change a record in a WebPublish database file. The -F DATA option
determines which file will be operated on. The value of -F can be
either account
, shell
, synch
, publish
, or mode
. Data that is included on
the command line will overwrite the original data values. Data that
is not included on the command line will remain unchanged in the
record. Here is an example that will change a record in the mode
database file.
webpublish --change -F mode -e css -m text
This is the command line option that is to be used when you must
remove a record from a WebPublish database file. The -F DATA option
determines which file will be operated on. The value of -F can be
either account
, shell
, synch
, publish
, or mode
. Here is an example
that will remove a record from the mode database file.
webpublish --remove -F mode -e html
This is the command line option that is to be used when you must
list one or more records in a WebPublish database file to stdout. The -F
DATA option determines which file will be operated on. The value of -F can be
either account
, shell
, synch
, publish
, or mode
. If an account name is
specified on the command line then only the items for the specified account
will be listed. If an account name is not specified on the command line then
all of the items in the WebPublish database file will be listed to stdout.
Here is an example that will list all of the accounts in the WebPublish
database.
webpublish --list -F account
This is the command line option that is to be used when you want to transfer files and directories to a server. See Publishing a Website, for a detailed description on the use of this command line option.
This is the command line option that is to be used when you want to remove files and directories from a server. See Synchronizing a Website, for a detailed description on the use of this command line option.