NAME
beacon - beacon command line client
SYNOPSIS
beacon [ <options> ] {KEY=VALUE} [ <command> <name> ] [ <file> ]
ARGUMENTS
-file <name> specify a BEACON file (use '-' for stdin)
-name <name> specify a name (for Beacons in a collection)
-pre <file> start with meta fields from a given BEACON file
-mtime use file's modification time if no TIMESTAMP given
-test enable test mode (no stored Beacon is modified)
-quiet suppress all error messages
-help brief help message
-man full documentation with examples
-verbose print additional messages
-dbi <dbi> database connection to a beacon collection
-config <file> specify config file, e.g. for database connection
about <name> show meta information about a file or stored beacon
parse <name> parse a full BEACON file and print meta information
dump <name> parse a BEACON file or dump a stored beacon
links <name> only print links, without meta fields
expand <name> parse and expand a BEACON file or dump a stored Beacon
query <name> <id> query a BEACON file or stored Beacon for an identifier
list list names of all Beacons in a collection
insert <name> <file> insert a new beacon from file to a collection
update <name> <file> replace a beacon from file to a collection
delete <name> remove a beacon from a collection
DESCRIPTION
This command line script manages beacon files. You can use it for parsing, validating, expanding, and storing beacon files.
COMMANDS
The first command line argument is treated as command or as [file]name, if it does not match a known command. The following commands are recognized:
- about
-
Print the meta fields. This command is the default, if no command is specified. Parsing BEACON file with this commands stops at the first non-meta line, so errors in the links will not be detected.
- parse
-
Print the meta fields, possibly extended by automatically generated fields, such as
COUNT
after parsing the full BEACON file. Use this command to validate a BEACON file. - links
-
Parse a BEACON file and print all valid links.
- dump
-
Parse a BEACON file and print all meta fields (possibly extended), followed by all valid links.
- expand
-
Print all valid links in fully expanded form, without meta fields.
- query
-
Query a BEACON file ore stored BEACON for an id (without prefix).
EXAMPLES
To show the meta fields of a BEACON file (command about
):
beacon about myfile
As about
is the default command, alternatively you can use one of:
beacon myfile
beacon -file myfile
beacon -file myfile about
To connect to a collection of Beacons, you can use the dbi option:
beacon -dbi SQLite:dbname=mydb.db
beacon -dbi mysql:database=mydb;mysql_read_default_file=.my.cnf
It is recommended to put dbi, user, and password in a configuration file. You can then simply say:
beacon -c my.conf list
beacon -c my.conf about mybeacon
beacon -c my.conf query mybeacon someid
To validate a BEACON file and show errors only:
beacon parse myfile > /dev/null
Prepend meta fields from file mfields
to BEACON file myfile
. Use last modification time of myfile
as TIMESTAMP if not included in myfile
:
beacon -pre myfields -mtime dump myfile
NOTE
The command name beacon
clashes with a tool of same name from the ax25-tools package (http://www.linux-ax25.org/). If you need to use beacon together with hamradio, you need to rename one of the two scripts.
AUTHOR
Jakob Voss <jakob.voss@gbv.de>
LICENSE
Copyright (C) 2010 by Verbundzentrale Goettingen (VZG) and Jakob Voss
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
In addition you may fork this library under the terms of the GNU Affero General Public License.