slarchive

slarchive connects to a SeedLink server, requests data streams and writes received packets into directory/file structures. The precise layout of the directories and files is defined in a format string. The implemented file layouts are: the SeisComP Data Structure (SDS), Buffer of Uniform Data structure (BUD) and the old SeisComP/datalog structure (DLOG) for backwards compatibility. To write more than one archive simply specify multiple format definitions (or presets).

Commandline options

-V
Print program version and exit.
-h
Print program usage and exit.
-v
Be more verbose. This flag can be used multiple times ("-v -v" or "-vv") for more verbosity. One flag: report basic handshaking (link configuration) details and briefly report each packet received. Two flags: report the details of the handshaking, each packet received and detailed connection diagnostics.
-p
Print details of received Mini-SEED data records. This flag can be used multiple times ("-p -p" or "-pp") for more detail. One flag: a single summary line for each data packet received. Two flags: details of the Mini-SEED data records received, including information from fixed header and 100/1000/1001 blockettes.
-nd delay <int>
The network reconnect delay (in seconds) for the connection to the SeedLink server. If the connection breaks for any reason this will govern how soon a reconnection should be attempted. The default value is 30 seconds.
-nt timeout <int>
The network timeout (in seconds) for the connection to the SeedLink server. If no data [or keep alive packets?] are received in this time range the connection is closed and re-established (after the reconnect delay has expired). The default value is 600 seconds. A value of 0 disables the timeout.
-k keepalive <int> (requires SeedLink version >= 3)
Interval (in seconds) at which keepalive (heartbeat) packets are sent to the server. Keepalive packets are only sent if nothing is received within the interval.
-x statefile[:interval]
During client shutdown the last received sequence numbers and time stamps (start times) for each data stream will be saved in this file. If this file exists upon startup the information will be used to resume the data streams from the point at which they were stopped. In this way the client can be stopped and started without data loss, assuming the data are still available on the server. If an interval is specified the state will be saved every interval in that packets are received. Otherwise the state will be saved only on normal program termination.
-i timeout <int>
Timeout for closing idle data stream files in seconds. The idle time of the data streams is only checked when some packets has arrived. If no packets arrived no idle stream files will be closed. There is no reason to change this parameter except for the unusual cases where the process is running against an open file number limit. Default is 300 seconds.
-d
Configure the connection in "dial-up" mode. The remote server will close the connection when it has sent all of the data in its buffers for the selected data streams. This is opposed to the normal behavior of waiting indefinitely for data.
-b
Configure the connection in "batch" mode.
-Fi[:overlap]
Future check initially. Check the last Mini-SEED data record in an existing archive file and do not write new data to that file if it is older than a certain overlap. The default overlap limit is 2 seconds; the overlap can be specified by appending a colon and the desired overlap limit in seconds to the option. If the overlap is exceeded an error message will be logged once for each time the file is opened. This option makes sense only for archive formats where each unique data stream is written to a unique file (e.g. SDS format). If a data stream is closed due to timeout (see option -i) the initial future check will be preformed when the file is re-opened.
-Fc[:overlap]
Future check continuously. Available only for archive Mini-SEED data records. Check if the first sample of the record is older than the last sample of the previous record for a given archive file, within a certain overlap. The default overlap limit is 2 seconds; the overlap can be specified by appending a colon and the desired overlap limit in seconds to the option. If the overlap is exceeded an error message will be logged once until either a non-overlapping packet is received or a new archive file is used. This option only makes sense for archive formats where each unique data stream is written to a unique file (e.g. SDS format).
-A <format>
If specified, all received packets (Mini-SEED records) will be appended to a directory/file structure defined by format. All directories implied in the format string will be created if necessary. The option may be used multiple times to write received packets to multiple archives. See the section “archiving data”.
-SDS <path>
If specified, all received packets (Mini-SEED records) will be saved into a Simple Data Structure (SDS) dir/file structure starting at the specified directory. This directory and all subdirectories will be created if necessary. This option is a preset of the '-A' option. The SDS dir/file structure is:

<SDSdir>/<YEAR>/<NET>/<STA>/<CHAN.TYPE>/NET.STA.LOC.CHAN.TYPE.YEAR.DAY.

Details are mentioned later on.
-BUD <path>
If specified, all received waveform data packets (Mini-SEED data records) will be saved into a Buffer of Uniform Data (BUD) dir/file structure starting at the specified directory. This directory and all subdirectories will be created if necessary. This option is a preset of the '-A' option. The BUD dir/file structure is:

<BUDdir>/<NET>/<STA>/STA.NET.LOC.CHAN.YEAR.DAY
-DLOG DLOGdir
If specified, all received packets (Mini-SEED data records) will be saved into an old style SeisComP/datalog dir/file structure starting at the specified directory. This directory and all subdirectories will be created if necessary. This option is a preset of the '-A' option. The DLOG dir/file structure is:

<DLOGdir>/<STA>/[LOC.]<CHAN>.<TYPE>/STA.NET.CHAN.TYPE.YEAR.DAY.HHMM
-l streamfile
The given file contains a list of streams. This option implies multi-station mode. The format of the stream list file is given below in the section ‘stream list file’.
-s selectors
Defining default selectors. If no multi-station data streams are configured these selectors will be used for uni-station mode. Otherwise these selectors will be used when no selectors are specified for a given stream with the '-S' or '-l' options.
-S stream[:selectors],... (requires SeedLink >= 2.5)
The connection will be configured in multi-station mode with optional SeedLink selectors for each station, see examples below. Stream should be provided in NET_STA format. If no selectors are provided for a given stream, the default selectors will be used, if defined.
-tw start:[end] (requires SeedLink >= 3)
Specifying a time window for the data streams that is applied by the server. The format for both times is year,month,day,hour,min,sec; for example: "2002,08,05,14,00:2002,08,05,14,15,00". The end time is optional but the colon must be present. If no end time is specified the server will send data indefinitely. This option will override any saved state information. Warning: time windowing might be disabled on the remote server.
[host][:][port]
A required argument, specifies the address of the SeedLink server in host:port format. Either the host, port or both can be omitted. If host is omitted then localhost is assumed, i.e. ':18000' implies 'localhost:18000'. If the port is omitted then 18000 is assumed, i.e. 'localhost' implies 'localhost:18000'. If only ':' is specified 'localhost:18000' is assumed.

SDS definition

The basic directory and file layout is defined as: <SDSdir>/Year/NET/STA/CHAN.TYPE/NET.STA.LOC.CHAN.TYPE.YEAR.DAY.
Definitions of fields:

SDSdir
arbitrary base directory
YEAR
4 digit YEAR
NET
Network code/identifier, 1-8 characters, no spaces
STA
Station code/identifier, 1-8 characters, no spaces
CHAN
Channel code/identifier, 1-8 characters, no spaces
TYPE
1 character, indicating the data type, provided types are:

typedescription
’D’ Waveform data
’E’ Detection data
’L’ Log data
’T’ Timing data
’C’ Calibration data
’R’ Response data
’O’Opaque data
LOC
Location identifier, 1-8 characters, no spaces
DAY
3 digit day of year, padded with zeros


The dots ’.’ in the file names must always be present regardless if neighboring fields are empty. Additional data type flags may be used for extended structure definition.