Technical data

PortServer Terminal Server Page 33
cpconf
Syntax: cpconf tohost|fromhost hostname filename
cpconf term
The cpconf (copy configuration) command was added to allow saving and restoring the con-
figuration of the PortServer to a disk file. The format of the save file is a list of the set
commands needed to set up the PortServer in the current configuration. These commands will be
read and acted on by the server (just as if the user had typed them on the command line) when
the configuration is restored.
Comment lines are allowed; the # character must be the first non-whitespace character on a
comment line. Such lines will be ignored by the PortServer command line interface.
There are two ways to store the data:
1. Use a terminal emulator program that can capture text to a file and send the text file back to
the PortServer;
2. Store and retrieve the configuration file from a host computer that serves TFTP file requests.
The TFTP server option is probably more convenient.
The command cpconf term will print the configuration directly to the terminal. To save the
configuration using a terminal emulation program, capture the output from the cpconf term
command into a file. To restore such a saved configuration, simply send the contents of the file to
the PortServer command line, which will run all the commands as if they were typed by the user
at the command line. If this method is used, it is very important that flow control works between
the PortServer and the terminal program.
To save the configuration to a TFTP server, use the command cpconf tohost hostname
filename. Either a true hostname or an ip address may be used for hostname. Filename is the
name of the file to be written; often this name must be a relative path name. (It depends upon the
particular TFTP server.) In many cases the TFTP server may require that the file already exist
and that it be world-writable before the TFTP transfer will be allowed.
An example of a way to create such a file on UNIX is:
touch /tftpboot/psconfig; chmod 666 /tftpboot/psconfig
To restore a configuration saved via TFTP, use the command cpconf fromhost hostname
filename.
Restoring the configuration takes quite a bit longer than saving it. This is because writing to the
EEPROM that stores the PortServer's configuration is a lot slower than reading.