Commands

All commands consist of a single word which specifies the command. This may be followed by arguments and/or switches. The general syntax rules of the getopts library apply.

addstyle

Synopsis

addstyle [-c] [-h] [-o | -O] {style-file...}

Description

Adds one or more bibliography style specifications from the input file(s).

Use the -c option to specify a command that will receive the output instead of the default pager. This may be a different pager, any command that takes input on stdin, or the string "stdout" to send the data to stdout without using a pager.

The -h option displays the online help about the addstyle command.

Use the -o and -O options to write or append the output to a file, respectively. This may be useful if you want to add a whole bunch of style files with a single command.

All other arguments are interpreted as the names of files containing style specifications.

Example

refdba: addstyle j.biol.chem.xml pharmacol.rev.xml

This will add the style specifications contained in the files j.biol.chem.xml and pharmacol.rev.xml to the bibliography style database.

adduser

Synopsis

adduser {-d database} [-h] {-H host-IP} [-N newpassword] [-r...] {-f file | username}

Description

Grants or revokes access rights to a refdb database to the given users. Specify the database with the -d option.

Note: If a user is not yet known as a MySQL user, refdb will create an account with the default access rights (=none). If you do not specify a password for the new user with the -N option (see below), the user will have access to the database server without a password. In most cases this is not a good thing.

A new user will automatically get access to the internal refdb databases refdb and refdbvar.

The -h option displays the online help about the adduser command.

The -H option takes a hostname as an argument. This is the name of the host the refdb application server runs on. If it runs on the same machine as the database server, you may specify localhost as hostname. Use "%" as hostname to allow access from all addresses except localhost. You can add the same user several times with different hostnames.

Use the -N option to specify the password for a new user. The password is encrypted before transferring it to the application server.

The -r option revokes the rights of the given users.

Note: refdb will only revoke the access rights to the particular database. It will revoke neither access rights to the internal databases refdb and refdbvar, nor will it revoke database server access. You can revoke access to the internal databases by specifying those databases with the -d option. To revoke access to the database server, please use the mysql command line utility.

All other arguments are interpreted as usernames. In addition to naming users explicitely, you can use the -f option to specify a file which contains a whitespace-separated list of usernames.

Example

refdba: adduser -d db1 -H 127.0.0.1 jim jane

This will grant access to the database db1 for the users jim and jane on localhost.

addword

Synopsis

addword [-h] [-r] {-f file | word...}

Description

Most bibliography styles use standardized abbreviations of the journal names. Most data sources specify these abbreviations without dots. If the words are to be abbreviated with dots (as in "Mol. Cell Biol.") in the bibliography, refdb needs to know which tokens in the abbreviated name are indeed abbreviated (e.g. "Mol."), and which are full words (e.g. "Cell"). To this end, refdb keeps a list of reserved words which are known not to be abbreviations of something else. refdb ships with a fairly complete list of such words, but if you detect errors or omissions, the addword command comes in handy.

The -h option displays the online help about the addword command.

The -r option instructs refdb to remove the given word or words from the list.

All other arguments are interpreted as reserved words. In addition to listing the words explicitly, you can use the -f option to specify a file which contains a whitespace-separated list of reserved words.

Note: refdb will convert all reserved words to uppercase, so it does not matter in which case you provide these words.

Example

refdba: addword -f wordlist FOO BAR

This will add all reserved words in the file wordlist as well as the words "FOO" and "BAR" to the list of reserved words.

confserv

Synopsis

confserv {command} [value]

Description

Configures the application server while it is running and does some tricks with the refdb helper databases as well. Some of the commands modify variables that can be set as command line arguments or with the init file. See Running the refdbd daemon for more information about these variables.

Note: This command will only reconfigure refdbd transiently. All changes are lost when the application server is restarted. To make permantent changes to the configuration, edit the init-file or change the command-line parameters in the script that starts refdbd. Please note also that remote administration must be enabled for this command to work.

The following commands are available:

stop

Stops the application server.

Note: This command affects only the refdbd parent process. Any children that may be currently serving clients will continue to do so until they are done.

ping

Checks whether the application server is still alive and well. If this is the case, it will report the process IDs of the child that handles your query and of the parent. If not, the connection will time out with no response.

cleanvar

This command removes temporary tables in the refdbvar database. The user clients should remove these tables after use, but in the case of a crash or a malfunction tables may be left over. To avoid deleting tables which are currently in use, precautions should be taken that no one is accessing the database while this command is used.

serverip value

Sets the database server IP address to value.

timeout value

Sets the timeout in seconds to value.

logdest value

Sets the destination of log output to value. Possible values are 0 (stderr), 1 (the system syslog facility), 2 (a private log file as defined by logfile).

logfile value

Sets the filename of the log file to value.

loglevel value

Sets the maximum level of messages to be logged to value. 0 means that only critical errors will be logged, 7 means that all messages including the extremely verbose debug messages will be logged. -1 disables logging completely.

Example

refdba: confserv loglevel 7

This will set the log level to 7. This temporary change will only be effective until refdbd is restarted.

createdb

Synopsis

createdb {dbname...}

Description

Creates a new database with the name dbname. Several databases may be specified in a single call of this command.

Tip: Prepend a constant string like "rd" to all refdb database names. This allows you to specifically retrieve refdb databases with the listdb command using a simple regular expression like "rd%". Otherwise you may see a plethora of non-refdb databases as well.

Example

refdba: createdb db1 db2

This will create the databases db1 and db2.

deletedb

Synopsis

deletedb [-h] {dbname...}

Description

Deletes the database with the name dbname. Several databases may be specified in a single call of this command.

The -h option displays a brief usage message and returns to the prompt.

Caution

The database structure and the data will be gone, really gone, so be careful with this command. Think twice and, if in doubt, at least make a backup first to avoid extensive hairpulling.

Example

refdba: deletedb db1 db2

This will delete the databases db1 and db2.

deletestyle

Synopsis

deletestyle [-h] {unix-regexp}

Description

Deletes the bibliography styles whose names match the Unix regular expression unix-regexp.

The -h option displays a brief usage message and returns to the prompt.

Example

refdba: deletestyle J\..*

This will delete all bibliography styles that start with "J.".

help

Synopsis

help

?

Description

Displays a brief summary of the available commands.

Example

refdba: help

listdb

Synopsis

listdb [SQL-regexp]

Description

Lists all available databases if no argument is specified. If SQL-regexp is specified, only the databases matching this expression will be listed. SQL-regexp has to be a valid SQL regular expression.

Example

refdba: listdb db%

This will list all databases with names that start with the string "db".

liststyle

Synopsis

liststyle {unix-regexp}

Description

Lists all available bibliography styles that match unix-regexp. unix-regexp has to be a valid Unix regular expression.

Example

refdba: liststyle ^J.*

This will list all bibliography styles that start with a capital "J".

listuser

Synopsis

listuser {unix-regexp}

Description

Lists all available users that match unix-regexp. unix-regexp has to be a valid Unix regular expression.

Example

refdba: listuser ^mo.*

This will list all database users that start with "mo".

listword

Synopsis

listword {unix-regexp}

Description

Lists all available reserved journal words that match unix-regexp. unix-regexp has to be a valid Unix regular expression. For a brief description of the purpose of reserved words, see the addword command.

Example

refdba: listword ^BIO.*

This will list all reserved journal words that start with "BIO".

set

Synopsis

set [-h] [varname] [varvalue]

Description

The set command displays or modifies the values of configuration variables.

If you call set without any arguments, it will display a list of all configuration variables with their current values.

If you call set with one argument, it will display the value of this particular variable.

If you call set with two arguments, it will set the variable (first argument) to the new value (second argument). To specify an empty value, use two quotation marks like this:"".

Run set -h to see a brief usage message.

Note: For obvious reasons, set will never display the current password although you can certainly change the password with this command. To make sure no one else sees the new password that you enter, run the command set passwd *. You will then be asked to enter a password which will not be echoed on the screen.

This command is not available in batch mode, use the command line switches instead. In the interactive mode, the changes to the configuration variables are limited to the current session. If you want to change the values permanently, you should rather edit one of the configuration files.

Example

refdba: set timeout 90

This command will set the timeout to 90 seconds for the current session.

verbose

Synopsis

verbose

Description

Toggles the verbose mode on or off. If the verbose mode is on, the error messages and warnings may be some more comprehensible.

Example

refdba: verbose

Depending on the previous setting, this will toggle the verbose mode on or off.

viewstat

Synopsis

viewstat

Description

Shows some statistics about the database, the connection information, and the version numbers of the database server and the client database library. It also shows the current values of the variables that can be modified with confserv.

Example

refdba: viewstat

This will print some connection statistics and informations on the screen.