pqcat - program to print products from an LDM product queue |
pqcat [-v] [-O] [-x] [-l logdest] [-f feedtype] [-p pattern] [-q pqfname] [-i interval] [-o offset] [-c] [-s] [outputfile] |
This program writes to outputfile selected data products from a local LDM product queue (see pq(3)). If no outputfile is specified, the data is written to standard output. The program may also be used to log product information about the products in a product queue whose identifiers match a specified feedtype and pattern. By default, pqcat starts at the front of the product queue (the oldest products) and iterates through products in order until it reaches the end of the queue (the most recently inserted products). On reaching the end of the queue it exits, unless a non zero interval is specified. pqcat is typically used to see what is in the product queue or to select particular products out of the product queue. |
-v |
Verbose logging. A line is emitted for every product in the queue whose feed type and identifier match the specified feedtype and pattern. The emitted line contains the UTC date and time, the program name, the product ingest time, feedtype, sequence number, size in bytes, and the product identifier. |
||
-O |
Show product origin. Adds originating site of product to each line of verbose output. Valid only with -v option. |
||
-x |
Debugging information is also emitted. |
−l logdest |
Log to logdest. One of ’’ (system logging daemon), ’-’ (standard error stream), or file logdest. Default is the standard error stream if the process has a controlling terminal (i.e., the process isn’t a daemon); otherwise, either the LDM log file or the system logging daemon (execute this program with just the option ’-?’ to determine which). |
−f feedtype |
Reads from the product queue only products that have a feedtype that is a member of the feedtype set. The default is ‘ANY’, specifying all feed types. See pqact(1) for a list of basic feed types and the use of feedtype expressions to specify combinations of basic feed types. |
−p pattern |
Reads from the product queue only products whose identifier matches the regular expression pattern. The default is ‘.*’, specifying all products. |
-q pqfname |
The filename of the product queue. The default is printed by the command regutil /queue/path. |
−i interval |
Polling interval, in seconds. When the end of the queue is reached, the program sleeps and checks for new products in the product queue every interval seconds. If the interval is 0, the program exits after one pass through the queue. When pqcat is run in the same process group as the programs that insert products into the product queue, a signal informs pqcat and all other interested processes in the process group whenever a new product is available. This may wake up the process sooner than interval. |
−o offset |
Offset time, in seconds. Begin reading products inserted into the product queue offset seconds earlier than the current time. The default is to read all products in the queue. |
-c |
Check each product. Recompute the MD5 checksum of product data and compare it against the the signature in product description. If the comparison fails, a message is emitted. |
||
-s |
Queue "sanity" check. Scans entire queue, tallies number of products encountered, and compares the result with the number of products the queue thinks it should have. If the LDM is not running and no product subsets are specified on the command line, the results should agree. This is a simplistic way to determine whether the queue is corrupted. Although it may be possible for the queue to be in a bad state for some other reason, it is expected that this test will catch most ways in which queue corruption can occur. Note that if the LDM is running or if a subset of products is specified on the command line with the -f or -p options, the two results will not agree and pqcat will exit with a nonzero value. It is intended that pqcat -s be run before starting the LDM in order to determine whether or not to rebuild the queue before starting. |
SIGTERM |
Normal termination. |
SIGINT |
Immediate termination. |
SIGUSR1 |
Refresh logging (if configure(1) executed without the "--with-ulog" option) and write status and product statistics to log output. |
SIGUSR2 |
Cyclically increment the verbosity of the program. Assumming the program was started without the -v or -x switches, the first SIGUSR2 will make it verbose and LOG_INFO priority messages will appear. The second will turn on the LOG_DEBUG priority messages as well. A third will take it back to the normal state. |
The following invocation will capture into the file /tmp/pq.contents information about all the products currently in the default product queue: |
pqcat -vl /tmp/pq.contents > /dev/null |
The following example will emit to stderr information about each product as it is inserted into a product queue in /tmp/ldm.pq, starting at the current time: |
pqcat -v -q /tmp/ldm.pq -o 0 -i 15 > /dev/null |
ldmd(1), pqact(1), ulog(3), pq(3), syslogd(8), WWW URL http://www.unidata.ucar.edu/software/ldm/. |
If you have problems with this program, then you should first examine the LDM email archive for similar problems and how they were solved. The email archive is available via the following World Wide Web URL: |
http://www.unidata.ucar.edu/software/ldm/ |
If this does not suffice and your site is a member of the Unidata program, then send an inquiry via email -- together will all relevant information -- to |
support-ldm@unidata.ucar.edu |