aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2015-04-01 17:05:08 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2015-04-01 17:05:08 +0300
commita51ba4fa1a4d3e2e868e1028c85145e302a1462d (patch)
treeeedbb0eb3213fdebb7de0a56e7f33988da569ebc
parent2fd19a6808a9d7b86ad294ae20ad9dcf1c4f6325 (diff)
downloaddnstools-a51ba4fa1a4d3e2e868e1028c85145e302a1462d.tar.gz
dnstools-a51ba4fa1a4d3e2e868e1028c85145e302a1462d.tar.bz2
Document nsdbimport
-rwxr-xr-xnsdbimport/nsdbimport176
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 {
410 pod2usage(-exitstatus => EX_OK, -verbose => 0); 410 pod2usage(-exitstatus => EX_OK, -verbose => 0);
411 }, 411 },
412 "directory|C=s" => \$bind_directory, 412 "directory|C=s" => \$bind_directory,
413 "from-config=s" => \$bind_config, 413 "bind-config|from-config=s" => \$bind_config,
414 "origin=s" => \$origin, 414 "origin=s" => \$origin,
415 "debug|d+" => \$debug, 415 "debug|d+" => \$debug,
416 "dry-run|n" => \$dry_run, 416 "dry-run|n" => \$dry_run,
@@ -422,7 +422,7 @@ unless (defined($conffile)) {
422 ($conffile) = grep { -e $_ } ( 422 ($conffile) = grep { -e $_ } (
423 '.nsdbimport.conf', 423 '.nsdbimport.conf',
424 "$ENV{HOME}/.nsdbimport.conf", 424 "$ENV{HOME}/.nsdbimport.conf",
425 'etc/.nsdbimport.conf'); 425 '/etc/.nsdbimport.conf');
426} 426}
427 427
428abend(EX_USAGE, "no configuration file; please use the --config option") 428abend(EX_USAGE, "no configuration file; please use the --config option")
@@ -485,3 +485,175 @@ error('set generate=yes to enable processing of $GENERATE directives')
485 if ($generate_seen); 485 if ($generate_seen);
486 486
487$dbd->disconnect; 487$dbd->disconnect;
488__END__
489=head1 NAME
490
491nsdbimport - import data from BIND-compatible zone files to SQL database
492
493=head1 SYNOPSIS
494
495B<nsdbimport>
496[B<-dhn>]
497[B<-C> I<DIR>]
498[B<-c> I<FILE>]
499[B<--bind-config=>I<FILE>]
500[B<--config=>I<FILE>
501[B<--debug>]
502[B<--directory=>I<DIR>]
503[B<--dry-run>]
504[B<--from-config=>I<FILE>]
505[B<--help>]
506[B<--origin=>I<ZONE>]
507[B<--usage>]
508[I<ZONEFILE>...]
509
510=head1 DESCRIPTION
511
512=head1 OPTIONS
513
514=over 4
515
516=item B<-d>, B<--debug>
517
518Increase debug level.
519
520=item B<-C> I<DIR>
521
522Set current working directory. All zone files specified with relative
523file names will be searched in that directory.
524
525=item B<-c>, B<--config=>I<FILE>
526
527Read configuration from I<FILE>. If this option is not given, B<nsdbimport>
528tries the following files: F<.nsdbimport.conf>, F<~/.nsdbimport.conf> and
529F</etc/.nsdbimport.conf>. First of them which exists is read. See the
530section B<CONFIGURATION> below for a discussion of configuration file format.
531
532=item B<--bind-config=>, B<--from-config=>I<FILE>
533
534Parse BIND configuration file I<FILE> and process all files corresponding
535to master zones. Note, that this option relies on B<cfpeek>(1) being
536installed on your system.
537
538=item B<-n>, B<--dry-run>
539
540Don't actually import data, print what would have been done instead.
541
542=item B<--origin=>I<ZONE>
543
544Set initial origin. Useful when processing individual files.
545
546=back
547
548The following options cause the program to display informative text and
549exit:
550
551=over 4
552
553=item B<-h>
554
555Show a short usage summary.
556
557=item B<--help>
558
559Show man page.
560
561=item B<--usage>
562
563Show a concise command line syntax reminder.
564
565=back
566
567=head1 CONFIGURATION
568
569Configuration file supplies credentials for accessing the database and
570templates for the SQL queries (normally, B<INSERT> statements) to be
571used in order to import records of particular B<RR> types.
572
573Upon startupe B<nsdbimport> looks for the following files (in that order):
574F<.nsdbimport.conf>, F<~/.nsdbimport.conf>, or F</etc/.nsdbimport.conf>.
575First of them that exists is read and parsed as a configuration file.
576
577If the command line option B<--config> (B<-c>) is given, its value is
578taken as the name of the configuration file to read. In that case,
579default configuration files are not scanned.
580
581Configuration consists of I<keyword>=I<value> pairs. Any amount of white
582space is allowed on either side of the equals sign. Each pair occupies
583a single logical line. To split very long lines, the usual backslash
584escaping is used: any line ending with a backslash immediately followed
585by a newline indicates continuation on the next line. The newline character
586is stripped off and the contents of the next line is appended in its place.
587
588Comments begin with B<#> character and extend to the end of physical line.
589
590Empty lines are ignored.
591
592The following statements configure database credentials
593
594=over 4
595
596=item B<database=>I<STRING>
597
598Database name.
599
600=item B<host=>I<NAME>
601
602Hostname or IP address of the host running the database server.
603
604=item B<port=>I<NUM>
605
606Port number, if differs from the default.
607
608=item B<db-params=>I<STRING>
609
610Additional options.
611
612=item B<user=>I<STRING>
613
614Database user name.
615
616=item B<password=>I<STRING>
617
618Password to connect to the database.
619
620=item B<db-default-file=>I<FILE>
621
622Pathname of the mysql defaults (a.k.a. options) file to use. The utility
623will look for the section B<[client]> and use options defined in it. The
624use of mysql defaults file is advised, instead of specifying database
625credentials in B<nsdbimport> configuration file.
626
627=back
628
629The following two options control how the import is performed, in general.
630
631=over 4
632
633=item B<generate=>I<no>|I<yes>
634
635Enable or disable processing of B<$GENERATE> directives. Such directives
636usually insert enormous amount of data into the database and therefore
637are disabled by default. Set B<generate = yes> to enable them.
638
639=item B<rr-query=>I<TEMPLATE>
640
641A generic query which inserts a single B<RR> record in the database. It
642will be used whenever a record is imported that has no special query
643statement defined for its B<RR> type.
644
645=back
646
647=head1 BUGS
648
649Only MySQL is supported.
650
651=head1 SEE ALSO
652
653B<cfpeek>(1), B<named>(8), B<named.conf>(5).
654
655=head1 AUTHOR
656
657Sergey Poznyakoff <gray@gnu.org>
658
659=cut

Return to:

Send suggestions and report system problems to the System administrator.