Node:Reference, Next:, Previous:A Trivial Example, Up:Top



Reference

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
Publish files and directories to server.
--synchronize
Remove files and directories from server.
--add
Add a new database record.
--change
Change an existing database record.
--remove
Remove an existing database record.
--list
List database records.

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
ACCT specifies the name of the account to operate on.
-w or --website DIR
DIR specifies the website (the local directory) to operate on.
-s or --server FTP
FTP specifies the name of the FTP server to connect with.
-u or --user USER
USER specifies the user name to use when logging into the FTP server.
-p or --password PASS
PASS specifies the password to use when logging into the FTP server.
-d or --directory DIR
DIR specifies a directory path.
-e or --extension EXT
EXT specifies a file extension.
-p or --path PATH
PATH specifies a file or directory path.
-D or --depth NUM
NUM specifies the number of directory levels to traverse.
-F or -file FILE
FILE specifies the database file to operate on. The value of FILE can be either 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
Write this help message to stdout.
-v or --version
Write a version string to stdout.
-V or --verbose
Write descriptive messages to stdout.
-f or --force
Force files to be transferred.
--prompt
Prompt the user before removing anythingfrom the server.

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

-h or -help

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.

-v or -version

This command line switch will cause WebPublish to write a brief version message to stdout.

-V or -verbose

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.

-f or -force

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.

-prompt

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.

-a or -account

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

-w or -website

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

-s or -server

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

-u or -user

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

-p or -password

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

-d or -directory

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

-e or -extension

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

-P or -path

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

-D or -depth

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

-F or -file

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

-add

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

-change

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

-remove

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

-list

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

-publish

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.

-synchronize

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.