NAME
sasbactrl - command line interface to SeeAlso::Source::BeaconAggregator and auxiliary classes
SYNOPSIS
sasbactrl [Options] [Action [Args ...]]
Actions and Arguments: init [--[no]redirs] [--itype type] Set up Database for dsn (dbroot must exist)
load alias [uri [file]]
update [pattern | seqno_or_alias [uri]]
status [seqno/alias/pattern] parts of "list" and "headers"
unload seqno/alias/pattern
purge seqno/alias/pattern
list [seqno/alias/pattern]
headers [seqno/alias/pattern]
header seqno/alias/pattern [field=val ...]
dumposd show OpenSearchDescription
refreshosd refresh (then show) OpenSearchDescription
dumpmeta [cgi_base_url ...] show beacon header
beacon cgi_base_url [uAformatname]
loadmeta header_template_file load OSD and Beacon meta constants
idststat [seqno/alias/pattern]
idcounts [identifier/pattern]
idlist [identifier/pattern]
admin [field[=value]] list/get/set admin properties:
DATA_VERSION
IDENTIFIER_CLASS
deflate Apply VACUUM and REINDEX on SqLite Db
version gives versions numbers of involved modules
noop do nothing (e.g. if --pragma's do all the work)
Options: (--dbfile | --dsn ) --force --keeposd --verbose|--quiet --itype --dbroot ($dbroot) --ignore-header-errors [for update and load] --distinct [for idcounts and idstat] --preset HEADER=value [for "beacon", repeatable]
--pragma [SQLite pragma] (repeatable)
--cache_size [SQLite pragma value]
OPTIONS
Global options for (almost) all types of actions
- --dbfile filename
-
Name of database file relative to
dbroot
- --dsn basename
-
Database file will be the file basename-db in folder basename, giving SQLite enough headroom for temporary files. Relative to
dbroot
. - --dbroot
-
Prefix for --dbfile or --dsn (relative paths only)
- --force
-
Use with care.
- --verbose
-
Sometimes shows more.
- --quiet
-
Sometimes shows less.
- --itype
-
Identifier type (corresponding subclass of SeeAlso::Identifier must be installed)
- --redirs=[0|1]
-
Prepare additional redirection index
- --ignore-header-errors
-
[for update and load]
- --distinct
-
[for idcounts and idstat]
Actions
These are typically an interface to methods of SeeAlso::Source::BeaconAggregator::Maintenance or of SeeAlso::Source::BeaconAggregator::Publisher
init
-
Creates a database with the necessary tables
list
-
Interface to the
listCollections()
method.List all loaded beacon files with identifier counts.
The optional parameter may specify a SQL-Pattern to restrict the result.
status
-
Prints the complete administrative fields and beacon fields and overview of the revisit policy for the beacon source(s) given by the first argument.
The first argument may be empty or a pattern to produce the information for more than one source.
headers
-
Interface to the
headers()
method.Prints all OSD fields and then all beacon fields.
The first argument is a sequence number, alias or pattern.
See
header
for restricting output to individual fields. header
-
Interface to the
headerfield()
method.The first parameter is a mandatory and specifies a sequence number, alias or pattern (e.g. "
%
") to operate on.Further arguments are of the form fieldname or fieldname=
value
(value may be empty): For each of these arguments output a line consisting of the field name, " - " and the list of all values encountered. Subsequently, if the assignment form of the argument is given, the corresponding field is set tovalue
for all sequences met.Otherwise (no list of field names or assignments is specified), output will be a list of all alias fields, roughly corresponding to
headerfield "%" _alias
.See
headers
for listing all fields defined for given sequences. load
-
load I<alias>, I<uri>, I<datafile>
Interface to the
loadFile()
orupdate()
methodsLoad beacon data from Uri (if uri is given) or physical file from disk (datafile must be given).
The beacon file will under the alias alias be ready for later updates.
update
-
Interface to the
update()
method(Re)load beacon files with known URIs according to the following policy: Respect the #REVISIT hint, assume a #REVISIT period of 24h for beacon files without. Wait at least 5% of the file's age (difference between last updateate attempt and modification time) before trying again. Wait at least 4h anyway. However force reload after a couple of months.
The
update
method itself detects illegal headers and if the beacon file was modified at all and may skip loading the file. Use the--force
option to override the test on modification time or clear the_mtime
field.When called with no arguments, update all beacon files.
purge
-
Interface to the <purge()> method.
Clears all beacon data for the seqnos or aliases given by the first argument: The beacon source with its metadata remains known to the database.
The argument may be a pattern, but the
--force
option is needed if actually more than one beacon file is to be purged).OSD fields are rebuild if something was done or
--force
is given. unload
-
Interface to the <unload()> method.
Clears all beacon data and removes the listed headers for the seqnos or aliases given by the first argument: Any knowledge of the beacon source is effectively deleted from the database.
The argument may be a pattern, but the
--force
option is needed if actually more than one beacon file is to be unloaded.OSD fields are rebuild if something was done or
--force
is given. idstat
-
Interface to the
idStat()
method.Counts indentifiers, optionally only from those beacon files with seqno or alias restricted by the first argument.
Recognized options are
distinct
andverbose
. idcounts
-
Interface to the
idCounts()
method.Counts identifiers, optionally only these identifiers which match the pattern given by the first argument.
Recognized options are
distinct
andverbose
. idlist
-
Interface to the
idList()
method.For each identifier list a complicated list of entries found. Optionally only these identifiers which match the pattern given by the first argument are shown.
dumpmeta
-
Interface to the
dumpmeta
method.Lists all header fields from the database.
beacon
-
Interface to the
beacon()
method.Produces a beacon file (header fields plus beacon entries) for the database.
The Base URL for the service to be denoted is mandatory as first parameter.
loadmeta
-
Completely exchanges the OSD and beacon meta files for the database by the contents of the file given as first argument.
dumposd
-
Shows Open Search Description.
refreshosd
-
Recalculates default Open Search Description (list constituents as description, give counts, find examples, ...)
- header
deflate
-
Interface to the
deflate()
method (DEFLATE+REINDEX+ANALYZE the SQLite database); version
-
Dump some version numbers
noop
-
Do nothing (you may want for exit status or use some --pragma's)
AUTHOR
Thomas Berger
CPAN ID: THB
gymel.com
THB@cpan.org
COPYRIGHT
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
SEE ALSO
SeeAlso::Source::BeaconAggregator::Maintenance SeeAlso::Source::BeaconAggregator::Publisher