diff options
Diffstat (limited to '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 @@ -410,7 +410,7 @@ GetOptions("h" => sub { pod2usage(-exitstatus => EX_OK, -verbose => 0); }, "directory|C=s" => \$bind_directory, - "from-config=s" => \$bind_config, + "bind-config|from-config=s" => \$bind_config, "origin=s" => \$origin, "debug|d+" => \$debug, "dry-run|n" => \$dry_run, @@ -422,7 +422,7 @@ unless (defined($conffile)) { ($conffile) = grep { -e $_ } ( '.nsdbimport.conf', "$ENV{HOME}/.nsdbimport.conf", - 'etc/.nsdbimport.conf'); + '/etc/.nsdbimport.conf'); } abend(EX_USAGE, "no configuration file; please use the --config option") @@ -485,3 +485,175 @@ error('set generate=yes to enable processing of $GENERATE directives') if ($generate_seen); $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 |