wcp Program Description
Invocation
File exclusions
User and superuser mode
wcpd configuration file
Server side invocation
This file describes most of the wcp and wcpd functionality. Some minor features may be missing yet, some features may not be fully explained. You should also consult the manpages.
wcp operation server [options]
where operation is one of
- get
-
fetch single files from the server.
- history
-
query file change information.
- list
-
get file listings from the server
- restore
-
restore files from the server.
- store
- store the local directory tree in the server space.
The server argument can either specify a local directory or a remote host using ssh as transport protocol with the notation
ssh://[user@]server:directory
The additional options depend on operation.
There are two other ways to specify the server parameter:
- by setting the environment variable WCP_SERVER. For this the variable WCP_USEENV must be set to "yes" (without the quotes).
- by giving the "-s server" option which must appear before the operation parameter. The -s option overwrite also settings from the environment.
In both cases wcp will not expect the server parameter on the command line.
Usually wcp will archive all files in it's current working directory and below. Files with blanks in their name are ignored.
Files can be excluded by specifying a size limit or a regular expression.
- -m maxsize[unit]
-
Files that are larger that maxsize bytes are ignored. maxsize may be followed by one of the characters b, k or M to set the value in bytes, kilobytes or megabytes. The default unit is kilobytes.
- -o pattern
- sets an extended regular expression for filenames to exclude.
Files can also be excluded on the server side with the maxsize and exclude configuration options which work exactly as described above.
There are two wcp modes: user mode for normal users and superuser mode when invoked by root. In superuser mode wcp has permissions to access all kind of files, in normal user mode not of course. To make things more difficult, wcp call it's server component wcpd which may also run in superuser or normal user mode. If none of the programs is setuid root the both program run with the same user id.
In user mode the programs will not have full permissions which has several effects:
- wcp may not be able to access all files in it's directory tree.
- When storing data, wcpd ignores all file attributes other than file size and last modification time on archiving and wcp on restore.
- In user mode both programs cannot create device files.
When running in mixed mode (on program in user, the other in superuser mode) the usermode restriction from above still apply to the non-root side. If e.g. wcpd runs in superuser mode wcp is able to store files with their correct permissions and onwnerships (as fas as wcp is permitted to access them). But since wcpd has actually no setuid control this is not recommended.
wcpd reads it's configuration from the file
- exclude pattern
-
sets an extended regular expression for filenames to exclude.
- maxsize maxsize[unit]
-
Files that are larger that maxsize bytes are ignored. maxsize may be followed by one of the characters b, k or M to set the value in bytes, kilobytes or megabytes. The default unit is kilobytes.
- timeout number
-
sets a timeout in seconds for the client/server communication, the default is 60.
- use-latest yes|no
-
specifies if the contents of wcpd's latest version file should be used to compute the next version or not. If use-latest is set andis not readable wcpd uses the available directories to compute the next version number.
- write-latest yes|no
-
specifies if wcpd should write the latest version in the file .or not. The default is no.
wcpd can initiate file archivals. For this wcpd must be started with the "-c connection-parameter" where connection-parameter has the form
ssh://[user[,sshkey]@]host:directory
where directory is the directory on host which should be archived.