diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2015-04-01 17:05:08 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2015-04-01 17:05:08 +0300 |
commit | a51ba4fa1a4d3e2e868e1028c85145e302a1462d (patch) | |
tree | eedbb0eb3213fdebb7de0a56e7f33988da569ebc | |
parent | 2fd19a6808a9d7b86ad294ae20ad9dcf1c4f6325 (diff) | |
download | dnstools-a51ba4fa1a4d3e2e868e1028c85145e302a1462d.tar.gz dnstools-a51ba4fa1a4d3e2e868e1028c85145e302a1462d.tar.bz2 |
Document nsdbimport
-rwxr-xr-x | nsdbimport/nsdbimport | 176 |
1 files changed, 174 insertions, 2 deletions
diff --git a/nsdbimport/nsdbimport b/nsdbimport/nsdbimport index da6b501..e2969c8 100755 --- a/nsdbimport/nsdbimport +++ b/nsdbimport/nsdbimport @@ -412,3 +412,3 @@ GetOptions("h" => sub { "directory|C=s" => \$bind_directory, - "from-config=s" => \$bind_config, + "bind-config|from-config=s" => \$bind_config, "origin=s" => \$origin, @@ -424,3 +424,3 @@ unless (defined($conffile)) { "$ENV{HOME}/.nsdbimport.conf", - 'etc/.nsdbimport.conf'); + '/etc/.nsdbimport.conf'); } @@ -487 +487,173 @@ error('set generate=yes to enable processing of $GENERATE directives') $dbd->disconnect; +__END__ +=head1 NAME + +nsdbimport - import data from BIND-compatible zone files to SQL database + +=head1 SYNOPSIS + +B<nsdbimport> +[B<-dhn>] +[B<-C> I<DIR>] +[B<-c> I<FILE>] +[B<--bind-config=>I<FILE>] +[B<--config=>I<FILE> +[B<--debug>] +[B<--directory=>I<DIR>] +[B<--dry-run>] +[B<--from-config=>I<FILE>] +[B<--help>] +[B<--origin=>I<ZONE>] +[B<--usage>] +[I<ZONEFILE>...] + +=head1 DESCRIPTION + +=head1 OPTIONS + +=over 4 + +=item B<-d>, B<--debug> + +Increase debug level. + +=item B<-C> I<DIR> + +Set current working directory. All zone files specified with relative +file names will be searched in that directory. + +=item B<-c>, B<--config=>I<FILE> + +Read configuration from I<FILE>. If this option is not given, B<nsdbimport> +tries the following files: F<.nsdbimport.conf>, F<~/.nsdbimport.conf> and +F</etc/.nsdbimport.conf>. First of them which exists is read. See the +section B<CONFIGURATION> below for a discussion of configuration file format. + +=item B<--bind-config=>, B<--from-config=>I<FILE> + +Parse BIND configuration file I<FILE> and process all files corresponding +to master zones. Note, that this option relies on B<cfpeek>(1) being +installed on your system. + +=item B<-n>, B<--dry-run> + +Don't actually import data, print what would have been done instead. + +=item B<--origin=>I<ZONE> + +Set initial origin. Useful when processing individual files. + +=back + +The following options cause the program to display informative text and +exit: + +=over 4 + +=item B<-h> + +Show a short usage summary. + +=item B<--help> + +Show man page. + +=item B<--usage> + +Show a concise command line syntax reminder. + +=back + +=head1 CONFIGURATION + +Configuration file supplies credentials for accessing the database and +templates for the SQL queries (normally, B<INSERT> statements) to be +used in order to import records of particular B<RR> types. + +Upon startupe B<nsdbimport> looks for the following files (in that order): +F<.nsdbimport.conf>, F<~/.nsdbimport.conf>, or F</etc/.nsdbimport.conf>. +First of them that exists is read and parsed as a configuration file. + +If the command line option B<--config> (B<-c>) is given, its value is +taken as the name of the configuration file to read. In that case, +default configuration files are not scanned. + +Configuration consists of I<keyword>=I<value> pairs. Any amount of white +space is allowed on either side of the equals sign. Each pair occupies +a single logical line. To split very long lines, the usual backslash +escaping is used: any line ending with a backslash immediately followed +by a newline indicates continuation on the next line. The newline character +is stripped off and the contents of the next line is appended in its place. + +Comments begin with B<#> character and extend to the end of physical line. + +Empty lines are ignored. + +The following statements configure database credentials + +=over 4 + +=item B<database=>I<STRING> + +Database name. + +=item B<host=>I<NAME> + +Hostname or IP address of the host running the database server. + +=item B<port=>I<NUM> + +Port number, if differs from the default. + +=item B<db-params=>I<STRING> + +Additional options. + +=item B<user=>I<STRING> + +Database user name. + +=item B<password=>I<STRING> + +Password to connect to the database. + +=item B<db-default-file=>I<FILE> + +Pathname of the mysql defaults (a.k.a. options) file to use. The utility +will look for the section B<[client]> and use options defined in it. The +use of mysql defaults file is advised, instead of specifying database +credentials in B<nsdbimport> configuration file. + +=back + +The following two options control how the import is performed, in general. + +=over 4 + +=item B<generate=>I<no>|I<yes> + +Enable or disable processing of B<$GENERATE> directives. Such directives +usually insert enormous amount of data into the database and therefore +are disabled by default. Set B<generate = yes> to enable them. + +=item B<rr-query=>I<TEMPLATE> + +A generic query which inserts a single B<RR> record in the database. It +will be used whenever a record is imported that has no special query +statement defined for its B<RR> type. + +=back + +=head1 BUGS + +Only MySQL is supported. + +=head1 SEE ALSO + +B<cfpeek>(1), B<named>(8), B<named.conf>(5). + +=head1 AUTHOR + +Sergey Poznyakoff <gray@gnu.org> + +=cut |