RWSENDER(8)

NAME
rwsender - Watch directory for files and transfer them to rwreceiver(s)

SYNOPSIS
  rwsender --mode=server --server-port=PORT
        --client-ident=IDENT [--client-ident=IDENT ...]
        --identifier=IDENT --incoming-directory=DIR
        [ --tls-ca=PEM_FILE
          { { --tls-cert=PEM_FILE --tls-key=PEM_FILE }
            | --tls-pkcs12=DER_FILE } ]
        --processing-directory=DIR --error-directory=DIR
        [--local-directory=[[IDENT]:]DIR
          [--local-directory=[[IDENT]:]DIR ...]]
        [--filter=IDENT:REGEXP] [--priority=NUM:REGEXP]
        [--polling-interval=NUM] [--block-size=NUM]
        { --log-destination=DESTINATION
          | --log-directory=DIR_PATH [--log-basename=LOG_BASENAME]
          | --log-pathname=FILE_PATH }
        [--log-level=LEVEL] [--log-sysfacility=NUMBER]
        [--pidfile=FILE_PATH] [--no-daemon]

  rwsender --mode=client --server-address=IDENT:ADDRESS:PORT
        [--server-address=IDENT:ADDRESS:PORT ...]
        --identifier=IDENT --incoming-directory=DIR
        [ --tls-ca=PEM_FILE
          { { --tls-cert=PEM_FILE --tls-key=PEM_FILE }
            | --tls-pkcs12=DER_FILE } ]
        --processing-directory=DIR --error-directory=DIR
        [--local-directory=[[IDENT]:]DIR
          [--local-directory=[[IDENT]:]DIR ...]]
        [--filter=IDENT:REGEXP] [--priority=NUM:REGEXP]
        [--polling-interval=NUM] [--block-size=NUM]
        { --log-destination=DESTINATION
          | --log-directory=DIR_PATH [--log-basename=LOG_BASENAME]
          | --log-pathname=FILE_PATH }
        [--log-level=LEVEL] [--log-sysfacility=NUMBER]
        [--pidfile=FILE_PATH] [--no-daemon]

  rwsender --help

  rwsender --version

DESCRIPTION
rwsender is a daemon which watches an incoming directory for files. When files are added, they are moved into a processing directory and then transferred over the network to one or more rwreceiver(8) processes.

Any file in the incoming directory whose size is 0 bytes or whose name begins with a dot "." is ignored.

Either rwsender or rwreceiver may act as the server with the other acting as the client. That is, an rwsender server may listen for connections from rwreceiver clients, or an rwsender client may attempt to connect to one or more rwreceiver servers.

In addition, each rwsender and rwreceiver is configured with an identifier of its own and the identifier(s) of the rwreceiver(s) or rwsender(s) that may connect to it. The connection will not established if the identifier provided by other process is not recognized.

Every rwsender that communicates with the same rwreceiver must have a unique identifier; likewise, every rwreceiver that communicates with the same rwsender must have a unique identifier. Ideally, the identifier should provide some information about where the rwsender or rwreceiver program is running and what sort of data it is transferring.

OPTIONS
Option names may be abbreviated if the abbreviation is unique or is an exact match for an option. A parameter to an option may be specified as --arg=param or --arg param, though the first form is required for options that take optional parameters.

The following set of switches are required:

--identifier=IDENT
    Use the name IDENT when establishing a connection with an rwreceiver process. The identifier should contain only printable, non-whitespace characters; the following characters are illegal: colon (":"), slash ("/" and "\"), period ("."), and comma (",").

--mode=MODE
    Specify how the connection between rwsender and rwreceiver(s) should be established. When MODE is server, rwsender will listen for connections from rwreceiver clients; when MODE is client, rwsender will attempt to connect to rwreceiver servers.

--incoming-directory=DIR
    Watch the directory DIR for files to transfer. rwsender ignores any files in this directory that are empty or whose names begin with a dot ("."). In addition, new files will only be considered when their size is constant for one polling-interval after they are first noticed.

--processing-directory=DIR
    Use DIR as a location to cache files until they are successfully transferred.

--error-directory=DIR
    Move a file that is rejected by an rwreceiver (for example, because it has a duplicate filename) to the subdirectory IDENT of DIR, where IDENT is the identifier of the rwreceiver that rejected the file.

--local-directory=[[IDENT]:]DIR
    Copy incoming files to the directory DIR. This option is repeatable. If possible, hard linking will be used, otherwise a full copy will be made. If IDENT is specified, filters can be used to determine which files get copied to DIR. See --filter for filter details. When DIR contains the colon character and no IDENT is wanted, a single colon can prepend DIR to designate an empty IDENT.

When running in server mode, the following switches are required:

--server-port=PORT
    Listen for incoming rwreceiver client connections on PORT.

--client-ident=IDENT
    Allow connections from an rwreceiver client whose identifier is IDENT. This switch may be repeated to allow multiple rwreceiver clients to connect.

When running in client mode, the following switch is required:

--server-address=IDENT:ADDRESS:PORT
    Attempt to connect to the rwreceiver server listening to port number PORT on the machine ADDRESS. The connection will be dropped unless the rwreceiver identifies itself as IDENT. This switch may be repeated to connect to multiple rwreceiver servers.

When SiLK is built with the GnuTLS (Transport Layer Security) library, the following switches are available. Using these switches allows rwsender and rwreceiver to use an encrypted/authenticated channel for their communication. Use GnuTLS's certtool(1) program to create the PEM (Privacy Enhanced Mail) file.

--tls-ca=PEM_FILE
    Sets the Certificate Authority file to the given PEM_FILE file, thereby enabling encryption using TLS. This switch must be used in conjunction with either the --tls-pkcs12 option, or the --tls-cert and the --tls-key options.

--tls-cert=PEM_FILE
    Sets rwsender's encryption certificate for TLS to the given PEM_FILE file. This switch must be used in conjunction with the --tls-ca and --tls-key options.

--tls-key=PEM_FILE
    Sets rwsender's encryption key for TLS to the given PEM_FILE. This switch must be used in conjunction with the --tls-ca and --tls-cert options.

--tls-pkcs12=DER_FILE
    Sets rwsender's encryption certificate and key for TLS to the given DER_FILE. This switch must be used in conjunction with the --tls-ca option. rwsender will use the value in the RWSENDER_TLS_PASSWORD environment variable to decrypt the PKCS#12 file. If this variable is not set, rwsender assumes the password is the empty string.

One of the following logging switches is required:

--log-destination=DESTINATION
    Specify the destination where logging messages are written. When DESTINATION begins with a slash "/", it is treated as a file system path and all log messages are written to that file; there is no log rotation. When DESTINATION does not begin with "/", it must be one of the following strings:

    "none"
        Messages are not written anywhere.

    "stdout"
        Messages are written to the standard output.

    "stderr"
        Messages are written to the standard error.

    "syslog"
        Messages are written using the syslog(3) facility.

    "both"
        Messages are written to the syslog facility and to the standard error (this option is not available on all platforms).

--log-directory=DIR_PATH
    Use DIR_PATH as the directory where the log files are written. DIR_PATH must be a complete directory path. The log files have the form

      DIR_PATH/LOG_BASENAME-YYYYMMDD.log

    where YYYYMMDD is the current date and LOG_BASENAME is the application name or the value passed to the --log-basename switch when provided. The log files will be rotated: at midnight local time a new log will be opened and the previous day's log file will be compressed using gzip(1). (Old log files are not removed by rwsender; the administrator should use another tool to remove them.) When this switch is provided, a process-ID file (PID) will also be written in this directory unless the --pidfile switch is provided.

--log-pathname=FILE_PATH
    Use FILE_PATH as the complete path to the log file. The log file will not be rotated.

The following switches are optional:

--filter=IDENT:REGEXP
    Configure rwsender to transfer files matching the regular expression REGEXP to the rwreceiver whose identifier is IDENT, or to copy files to the local directory labeled as IDENT. This switch may be repeated. When this switch is not provided, all rwreceivers and local directories get all files. When this switch is provided, any files not matching a REGEXP are left in the incoming directory and are not transferred.

    The regular expression must be a POSIX 1003.2 modern or extended regular expressions, roughly akin to those used by egrep(1). Documentation might be found in the regex(7) or re_format(7) manual pages on your system.

--priority=NUM:REGEXP
    Set the priority of files that match REGEXP to NUM. NUM must be an integer between 0 and 100 inclusive. In the current version of rwsender, priorities 0 through 50 get grouped into a single low priority bin, and priorities 51 through 100 get grouped into a single high priority bin. Files in the high priority bin will generally be sent before files in the low priority bin. The default priority of a file is 50. This switch can be repeated for multiple priorities.

--polling-interval=NUM
    Configure rwsender to check the incoming directory for new files every NUM seconds. The default polling interval is 15 seconds.

--block-size=NUM
    Specify the chunk size in bytes that rwsender will use when sending files to rwreceivers. The default number of bytes is 8192; the valid range is 1 to 65527.

--log-level=LEVEL
    Set the severity of messages that will be logged. The levels from most severe to least are: "emerg", "alert", "crit", "err", "warning", "notice", "info", "debug". The default is "info".

--log-sysfacility=NUMBER
    Set the facility that syslog(3) uses for logging messages. This switch takes a number as an argument; the default will be value that corresponds to "LOG_USER" on the system where rwsender is running. This switch will result in an error unless --log-destination=syslog is specified.

--log-basename=LOG_BASENAME
    Use LOG_BASENAME in place of the application name for the files in the log directory; see the description of the --log-directory switch.

--pidfile=FILE_PATH
    Set the complete path to the file in which rwsender writes its process ID (PID) when it is running as a daemon. No PID file is written when --no-daemon is given. When this switch is not present, no PID file is written unless the --log-directory switch is specified, in which case the PID is written to LOGPATH/rwsender.pid.

--no-daemon
    Set rwsender to run in the foreground, as a non-daemonized process. This is useful for debugging.

--help
    Print the available options and exit.

--version
    Print the version number and information about how SiLK was configured, then exit the application.

ENVIRONMENT

RWSENDER_TLS_PASSWORD
    Specifies the password to use to decrypt the PKCS#12 file specified in the --tls-pkcs12 switch.

SEE ALSO
SiLK Installation Handbook, rwreceiver(8), syslog(3), certtool(1), egrep(1), regex(7), re_format(7)

BUGS
An attempt should be made to use a unique name for each file put into the incoming directory; rwsender will exit if a file put into the incoming directory has the same name as a file that exists in the processing directory.