From 2bc6feb9479389b2b9464110b3c6252bb08ee90f Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Mon, 26 Jun 2006 19:52:15 +0000 Subject: [PATCH] - Write install/uninstall of new manpages. There are now a pile of man pages. Some of which need a lot of work. ============= Warning ================================== The --mandir ./configure option now points to the top level man directory. The man files will be installed under mandir/man8 and mandir/man1 as appropriate. =========================================================== git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3080 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/autoconf/Make.common.in | 3 +- bacula/kes-1.39 | 9 ++ bacula/manpages/Makefile.in | 31 ++++- bacula/manpages/bacula-traymonitor.1 | 10 +- bacula/manpages/bacula-wxconsole.1 | 2 +- bacula/manpages/bconsole.8 | 6 +- bacula/manpages/bsmtp.1 | 52 ++++++++ bacula/manpages/dbcheck.8 | 186 ++++++++++++++++++++++----- bacula/src/dird/run_conf.c | 2 +- 9 files changed, 253 insertions(+), 48 deletions(-) diff --git a/bacula/autoconf/Make.common.in b/bacula/autoconf/Make.common.in index a21d24e8a7..f8b6daa6c7 100644 --- a/bacula/autoconf/Make.common.in +++ b/bacula/autoconf/Make.common.in @@ -23,7 +23,7 @@ manprefix = sbindir = @sbindir@ sysconfdir = @sysconfdir@ scriptdir = @scriptdir@ -mandir = @mandir@/man8 +mandir = @mandir@ manext = 8 NO_ECHO = @ @@ -43,6 +43,7 @@ CMP = @CMP@ TBL = @TBL@ AR = @AR@ RANLIB = @RANLIB@ +MKDIR = @BUILD_DIR@/autoconf/mkinstalldirs INSTALL = @INSTALL@ # add the -s to the following in PRODUCTION mode INSTALL_PROGRAM = @INSTALL@ -m @SBINPERM@ diff --git a/bacula/kes-1.39 b/bacula/kes-1.39 index f575d93bcc..c011275301 100644 --- a/bacula/kes-1.39 +++ b/bacula/kes-1.39 @@ -3,6 +3,15 @@ General: 26Jun06 +- Write install/uninstall of new manpages. There are now a + pile of man pages. Some of which need a lot of work. + + ============= Warning ================================== + The --mandir ./configure option now points to the top level + man directory. The man files will be installed under + mandir/man8 and mandir/man1 as appropriate. + =========================================================== + - Add complete text of GPL to LICENSE. - Implement job report that indicates where Storage and Pool came from -- with overrides and Pool storage and NextPool, diff --git a/bacula/manpages/Makefile.in b/bacula/manpages/Makefile.in index 01362ba893..47c5e21d69 100644 --- a/bacula/manpages/Makefile.in +++ b/bacula/manpages/Makefile.in @@ -1,5 +1,7 @@ # # +@MCOMMON@ + .PHONY: dummy MAN8 = bacula.8 bacula-dir.8 bacul-fd.8 bacula-sd.8 \ @@ -11,13 +13,30 @@ MAN1 = bacula-console-gnome.1 bacula-tray-monitor.1 \ install: - gzip bacula.8.gz - $(INSTALL_DATA) bacula.8.gz $(DESTDIR)$(mandir)/bacula.8.gz - @rm -f bacula.8.gz + $(MKDIR) $(DESTDIR)/$(mandir)/man8 + for I in ${MAN8}; \ + do ($(RMF) $$I.gz; gzip -c $$I >$$I.gz; \ + $(INSTALL_DATA) $$I.gz $(DESTDIR)$(mandir)/man8/$$I.gz; \ + rm -f $$I.gz); \ + done + $(MKDIR) $(DESTDIR)/$(mandir)/man1 + for I in ${MAN1}; \ + do ($(RMF) $$I.gz; gzip -c $$I >$$I.gz; \ + $(INSTALL_DATA) $$I.gz $(DESTDIR)$(mandir)/man1/$$I.gz; \ + rm -f $$I.gz); \ + done uninstall: - (cd $(DESTDIR)$(mandir); $(RMF) bacula.8.gz) + for I in ${MAN8}; \ + do (rm -f $(DESTDIR)$(mandir)/man8/$$I.gz); \ + done + for I in ${MAN1}; \ + do (rm -f $(DESTDIR)$(mandir)/man1/$$I.gz); \ + done +clean: dummy + $(RMF) *~ 1 2 3 *.bak + @find . -name .#* -exec $(RMF) {} \; -tidy: dummy - rm -f *~ +distclean: clean + $(RMF) Makefile diff --git a/bacula/manpages/bacula-traymonitor.1 b/bacula/manpages/bacula-traymonitor.1 index e526fed075..f23f8c2cb1 100644 --- a/bacula/manpages/bacula-traymonitor.1 +++ b/bacula/manpages/bacula-traymonitor.1 @@ -2,22 +2,22 @@ .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) -.TH WX-CONSOLE 1 "Apr 28, 2004" "Kern Sibbald&John Walker" "Network backup, recovery and verification" +.TH TRAY-MONITOR 1 "Apr 28, 2004" "Kern Sibbald&John Walker" "Network backup, recovery and verification" .\" Please adjust this date whenever revising the manpage. .\" .SH NAME - wx-console \- Bacula's management Console + tray-monitor \- Bacula's KDE/GNOME tray monitor/ .SH SYNOPSIS .B wx-console .RI [options] .br .SH DESCRIPTION This manual page documents briefly the -.B wx-console -command, the wxWidgets version of the Bacula administration console. +.B tray-console +command. .PP .SH OPTIONS -console [\-s] [\-c config_file] [\-d debug_level] [config_file] +tray-monitor [\-s] [\-c config_file] [\-d debug_level] [config_file] .TP .B \-c Specify configuration file. diff --git a/bacula/manpages/bacula-wxconsole.1 b/bacula/manpages/bacula-wxconsole.1 index 909165be14..959e5132c7 100644 --- a/bacula/manpages/bacula-wxconsole.1 +++ b/bacula/manpages/bacula-wxconsole.1 @@ -17,7 +17,7 @@ This manual page documents briefly the command, the wxWidgets version of the Bacula administration console. .PP .SH OPTIONS -console [\-s] [\-c config_file] [\-d debug_level] [-t] +wx-console [\-s] [\-c config_file] [\-d debug_level] [-t] .TP .B \-c Specify configuration file. diff --git a/bacula/manpages/bconsole.8 b/bacula/manpages/bconsole.8 index b2c695e91e..222cf3b86a 100644 --- a/bacula/manpages/bconsole.8 +++ b/bacula/manpages/bconsole.8 @@ -6,14 +6,14 @@ .\" Please adjust this date whenever revising the manpage. .\" .SH NAME - console \- Bacula's management Console + bconsole \- Bacula's management Console .SH SYNOPSIS -.B console +.B bconsole .RI [options] .br .SH DESCRIPTION This manual page documents briefly the -.B console +.B bconsole command. .PP .SH OPTIONS diff --git a/bacula/manpages/bsmtp.1 b/bacula/manpages/bsmtp.1 index 42be49ed17..08bb30cc15 100644 --- a/bacula/manpages/bsmtp.1 +++ b/bacula/manpages/bsmtp.1 @@ -4,6 +4,58 @@ .SH NAME bsmtp \- Bacula's SMTP (mail delivery program) .SH DESCRIPTION +bsmtp is a simple mail transport program that permits more flexibility +than the standard mail programs typically found on Unix systems. It can even +be used on Windows machines. + +It is called: + +Usage: bsmtp [-f from] [-h mailhost] [-s subject] [-c copy] [recipient ...] + -c set the Cc: field + -dnn set debug level to nn + -f set the From: field + -h use mailhost:port as the bsmtp server + -s set the Subject: field + -? print this message. + +If the -f option is not specified, bsmtp will use your userid. If +the option is not specified bsmtp will use the value in the environment +variable bsmtpSERVER or if there is none localhost. By default +port 25 is used. + +recipients is a space separated list of email recipients. + +The body of the email message is read from standard input. + +An example of the use of bsmtp would be to put the following statement +in the Messages resource of your bacula-dir.conf file. Note, these +commands should appear on a single line each. + + mailcommand = "/home/bacula/bin/bsmtp -h mail.domain.com -f \"\(Bacula\) %r\" + -s \"Bacula: %t %e of %c %l\" %r" + operatorcommand = "/home/bacula/bin/bsmtp -h mail.domain.com -f \"\(Bacula\) %r\" + -s \"Bacula: Intervention needed for %j\" %r" + +Where you replace home/bacula/bin with the path to your Bacula +binary directory, and you replace mail.domain.com with the fully +qualified name of your bsmtp (email) server, which normally listens on port + +It is HIGHLY recommended that you test one or two cases by hand to make sure +that the mailhost that you specified is correct and that it will accept +your email requests. Since bsmtp always uses a TCP connection rather +than writing in the spool file, you may find that your from address is +being rejected because it does not contain a valid domain, or because your +message is caught in your spam filtering rules. Generally, you should specify +a fully qualified domain name in the from field, and depending on +whether your bsmtp gateway is Exim or Sendmail, you may need to modify the +syntax of the from part of the message. Please test. + +When running bsmtp by hand, you will need to terminate the message by +entering a ctl-d in column 1 of the last line. + +If you are getting incorrect dates (e.g. 1970) and you are +running with a non-English language setting, you might try adding +a LANG="en_US" immediately before the bsmtp call. .br .SH AUTHOR This manual page was written by Jose Luis Tallon diff --git a/bacula/manpages/dbcheck.8 b/bacula/manpages/dbcheck.8 index 9c31937e38..fb1ec8ddd6 100644 --- a/bacula/manpages/dbcheck.8 +++ b/bacula/manpages/dbcheck.8 @@ -6,7 +6,7 @@ .\" Please adjust this date whenever revising the manpage. .\" .SH NAME - bcopy \- Bacula's DB Check + dbcheck \- Bacula's Catalog Database Check/Clean program .SH SYNOPSIS .B bcopy .RI [ options ] @@ -17,38 +17,162 @@ .br .SH DESCRIPTION This manual page documents briefly the -.B bcopy +.B dbcheck command. .PP -.\" TeX users may be more comfortable with the \fB\fP and -.\" \fI\fP escape sequences to invode bold face and italics, -.\" respectively. -.SH OPTIONS -A summary of options is included below. -.TP -.B \-? -Show version and usage of program. -.TP -.BI \-b\ bootstrap -Specify a bootstrap file. -.TP -.BI \-c\ config -Specify configuration file. -.TP -.BI \-d\ nn -Set debug level to \fInn\fP. -.TP -.BI \-i\ input -Specify input Volume names (separated by '|') -.TP -.BI \-o\ output -Specify output Volume names (separated by '|') -.TP -.BI \-w\ directory -Specify working directory (default \fI/tmp\fP). -.TP -.B \-v -Set verbose mode. +dbcheck is a simple program that will search for logical +inconsistencies in the Bacula tables in your database, and optionally fix them. +It is a database maintenance routine, in the sense that it can +detect and remove unused rows, but it is not a database repair +routine. To repair a database, see the tools furnished by the +database vendor. Normally dbcheck should never need to be run, +but if Bacula has crashed or you have a lot of Clients, Pools, or +Jobs that you have removed, it could be useful. + +It is called: + +Usage: dbcheck [-c config] [-C catalog name] [-d debug_level] [] + -b batch mode + -C catalog name in the director conf file + -c director conf filename + -dnn set debug level to nn + -f fix inconsistencies + -v verbose + -? print this message + +If the -c option is given with the Director's conf file, there is no +need to enter any of the command line arguments, in particular the working +directory as dbcheck will read them from the file. + +If the -f option is specified, dbcheck will repair (fix) the +inconsistencies it finds. Otherwise, it will report only. + +If the -b option is specified, dbcheck will run in batch mode, and +it will proceed to examine and fix (if -f is set) all programmed inconsistency +checks. If the -b option is not specified, dbcheck will enter +interactive mode and prompt with the following: + +Hello, this is the database check/correct program. +Please select the function you want to perform. + 1) Toggle modify database flag + 2) Toggle verbose flag + 3) Repair bad Filename records + 4) Repair bad Path records + 5) Eliminate duplicate Filename records + 6) Eliminate duplicate Path records + 7) Eliminate orphaned Jobmedia records + 8) Eliminate orphaned File records + 9) Eliminate orphaned Path records + 10) Eliminate orphaned Filename records + 11) Eliminate orphaned FileSet records + 12) Eliminate orphaned Client records + 13) Eliminate orphaned Job records + 14) Eliminate all Admin records + 15) Eliminate all Restore records + 16) All (3-15) + 17) Quit +Select function number: + +By entering 1 or 2, you can toggle the modify database flag (-f option) and +the verbose flag (-v). It can be helpful and reassuring to turn off the modify +database flag, then select one or more of the consistency checks (items 3 +through 9) to see what will be done, then toggle the modify flag on and re-run +the check. + +The inconsistencies examined are the following: + +.BR + Duplicate filename records. This can happen if you accidentally run two + copies of Bacula at the same time, and they are both adding filenames + simultaneously. It is a rare occurrence, but will create an inconsistent + database. If this is the case, you will receive error messages during Jobs + warning of duplicate database records. If you are not getting these error + messages, there is no reason to run this check. + +.BR +Repair bad Filename records. This checks and corrects filenames that + have a trailing slash. They should not. + +.BR +Repair bad Path records. This checks and corrects path names that do + not have a trailing slash. They should. + +.BR +Duplicate path records. This can happen if you accidentally run two + copies of Bacula at the same time, and they are both adding filenames + simultaneously. It is a rare occurrence, but will create an inconsistent + database. See the item above for why this occurs and how you know it is + happening. + +.BR +Orphaned JobMedia records. This happens when a Job record is deleted + (perhaps by a user issued SQL statement), but the corresponding JobMedia + record (one for each Volume used in the Job) was not deleted. Normally, this + should not happen, and even if it does, these records generally do not take + much space in your database. However, by running this check, you can + eliminate any such orphans. + +.BR +Orphaned File records. This happens when a Job record is deleted + (perhaps by a user issued SQL statement), but the corresponding File record + (one for each Volume used in the Job) was not deleted. Note, searching for + these records can be {\bf very} time consuming (i.e. it may take hours) for a + large database. Normally this should not happen as Bacula takes care to + prevent it. Just the same, this check can remove any orphaned File records. + It is recommended that you run this once a year since orphaned File records + can take a large amount of space in your database. You might + want to ensure that you have indexes on JobId, FilenameId, and + PathId for the File table in your catalog before running this + command. + +.BR +Orphaned Path records. This condition happens any time a directory is + deleted from your system and all associated Job records have been purged. + During standard purging (or pruning) of Job records, Bacula does not check + for orphaned Path records. As a consequence, over a period of time, old + unused Path records will tend to accumulate and use space in your database. + This check will eliminate them. It is recommended that you run this + check at least once a year. + +.BR +Orphaned Filename records. This condition happens any time a file is + deleted from your system and all associated Job records have been purged. + This can happen quite frequently as there are quite a large number of files + that are created and then deleted. In addition, if you do a system update or + delete an entire directory, there can be a very large number of Filename + records that remain in the catalog but are no longer used. + + During standard purging (or pruning) of Job records, Bacula does not check + for orphaned Filename records. As a consequence, over a period of time, old + unused Filename records will accumulate and use space in your database. This + check will eliminate them. It is strongly recommended that you run this check + at least once a year, and for large database (more than 200 Megabytes), it is + probably better to run this once every 6 months. + +.BR +Orphaned Client records. These records can remain in the database long + after you have removed a client. + +.BR +Orphaned Job records. If no client is defined for a job or you do not + run a job for a long time, you can accumulate old job records. This option + allow you to remove jobs that are not attached to any client (and thus + useless). + +.BR +All Admin records. This command will remove all Admin records, + regardless of their age. + +.BR +All Restore records. This command will remove all Restore records, + regardless of their age. + +By the way, I personally run dbcheck only where I have messed up +my database due to a bug in developing Bacula code, so normally +you should never need to run dbcheck inspite of the +recommendations given above, which are given so that users don't +waste their time running dbcheck too often. + .SH SEE ALSO .BR bls (1), .BR bextract (1). diff --git a/bacula/src/dird/run_conf.c b/bacula/src/dird/run_conf.c index acae9b2885..44337d50fb 100644 --- a/bacula/src/dird/run_conf.c +++ b/bacula/src/dird/run_conf.c @@ -8,7 +8,7 @@ * Version $Id$ */ /* - Copyright (C) 2000-2005 Kern Sibbald + Copyright (C) 2000-2006 Kern Sibbald This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -- 2.39.5