Information Files


All of the information determining how a transfer is performed can be stored in a file to be read by transfer. Such files are called "information" files. transfer will read an information file that is specified on the command line using the "-f" option or will gather information from the default information file $HOME/.transferrc if the "-f" flag is not used and the HOME environment variable is set.

Here is an example information file.


# Comment at the beginning of the information file.
# This is an example information file.

connect     = /sbin/connect;
disconnect  = /sbin/disconnect > /dev/null;
host        = dante.u.washington.edu;   # As good a place as any.
username    = batman;                   # Only an example.
password    = not2long;                 # Only an example.

logfile     = /home/bwayne/log/transfer_log;
local_root  = /home/bwayne;  # Local username = bwayne.
remote_root = .;  # How to specify the remote home directory
                  # as the remote root.

list        = crime_files,             # The crime_files directory.
              utilities,               # The utilities directory.
              mail_from_commissioner;  # Important message file.

exclusions  = crime_files/huge_data_file, # Too large.
              utilities/output,           # Easy to recreate.
              utilities/tmp;              # Unimportant.

# This comment marks the end of the information file.


Each information line in an information file consists of a key word followed by an equal sign followed by a value and is terminated by a semi-colon. This means that the password for the remote account and connect and disconnect commands cannot contain semi-colons. Information lines may span several lines in the file just like lines of C code. If a key word refers to a list of values rather than a single value, the list must be written as a comma-separated list.

An information file may contain comments which consist of anything following the character "#". Comments may occupy entire lines or may be at the end of lines. Information files may contain blank lines and the information in the file may have an arbitrary amount of white space surrounding it. White space is strings of characters such as spaces, tabs, line feeds, or returns.

The example demonstrates how one can use comments, white space, and blank lines in an information file. There can be white space between the values and the terminating semi-colon too.

This information file also contains all of the key words used by transfer. The key words and the values they refer to are summarized in the following table.


Transfer Key Words
Key Word Information
connect connect command
disconnect disconnect command
host FQDN or IP address of remote host
username username for remote account
password password for remote account
logfile full path to local log file
local_root full path to local root directory
remote_root relative path to remote root directory
list list of files and directories to transfer
exclusions list of files and directories to exclude from transfer

The host name needs to be sufficient to allow the local host to contact the remote host. Also, the list of files to be transferred and the exclusions list must be lists of paths relative to the local root. See Information for more detailed descriptions of the information that transfer uses to execute a transfer.

Two important features of an information file are illustrated above. First, notice that the list of files and directories to be transferred and the list of files and directories to be excluded from transfer are comma-separated lists. In the example, crime_files, utilities, utilities/output, and utilities/tmp are directories and mail_from_commissioner and huge_data_file are files. This also shows a few types of files and directories that you may not want to transfer. The directory programs/tmp probably doesn't contain anything worth keeping for long, it may not be worth transferring files that are easily recreated, and you may not have enough space on the remote host to store very large files.

The second important feature of the example information file is that the remote root is specified as ".". In UNIX, a single dot represents the current directory. This is the way that you specify the home directory for the remote account as the remote root. A blank value WILL NOT WORK and will result in unpredictable results.

An information file can specify any subset of the above information. The remaining information can be entered through the command line and transfer will prompt the user for any required information that is not provided in the file or on the command line. If an information file is given on the command line using the "-f" flag and any optional information is not provided by the file or on the command line, then transfer will not prompt the user for any of the missing optional information. See Information for lists of required versus optional information.