]> git.sur5r.net Git - bacula/bacula/commitdiff
Update doc
authorKern Sibbald <kern@sibbald.com>
Fri, 3 Jan 2003 19:09:12 +0000 (19:09 +0000)
committerKern Sibbald <kern@sibbald.com>
Fri, 3 Jan 2003 19:09:12 +0000 (19:09 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@261 91ce42f0-d328-0410-95d8-f526ca767f89

12 files changed:
bacula/ChangeLog
bacula/Makefile.in
bacula/ReleaseNotes
bacula/autoconf/configure.in
bacula/configure
bacula/kernstodo
bacula/src/cats/Makefile.in
bacula/src/cats/delete_catalog_backup.in [new file with mode: 0755]
bacula/src/cats/make_catalog_backup.in [new file with mode: 0755]
bacula/src/dird/bacula-dir.conf.in
bacula/src/dird/dird_conf.c
bacula/src/dird/ua_status.c

index 43bfee0c47c1184ef12904e2f45504cf2339fd04..d908612815ed66fd53d9bfdc1d062357b094b70a 100644 (file)
@@ -13,6 +13,19 @@ General:
   tape drivers.
 
 Changes submitted this submission:
+03Jan03
+- Add scripts make_catalog_backup and delete_catalog_backup that makes and
+  deletes an ASCII copy of the catalog for backup. An example of how
+  to use it is in the <bacula-src/src/dird/bacula-dir.conf file.
+- Made a nicer column oriented listing of scheduled jobs for "status dir".
+02Jan03
+- Added backup/restore of raw partitions.
+- Corrected restoration of files in root directory (problem with
+  splitting path from file).
+01Jan03
+- Finally decided to cleanup handling of splitting path and filenames
+  in the cats directory. Now the code is in one place sql.c and it
+  is done using Pool memory, so there are no length restrictions.
 31Dec02
 - Add start of Solaris bare metal recovery
 - Add Site Visit usage statistics to Web page
index a6f56da8767bdcf85846af17aac1d54fc9745c18..15479b92f92b9ea64f7b03ea164e288d1b779977 100755 (executable)
@@ -117,6 +117,7 @@ Makefiles:
        chmod 755 src/cats/make_bdb_tables src/cats/drop_bdb_tables
        chmod 755 src/cats/make_test_tables src/cats/drop_test_tables
        chmod 755 src/cats/create_mysql_database
+       chmod 755 src/cats/make_catalog_backup src/cats/delete_catalog_backup
        chmod 755 src/cats/alter_mysql_tables
        chmod 755 src/cats/create_sqlite_database
        chmod 755 src/cats/alter_sqlite_tables
index c34632781a9ffa6f7c1963db5ac33e2b308e6039..e0be1a3e46e3c383595620f44f6d3fa2d1a17880 100644 (file)
@@ -3,13 +3,15 @@
   Bacula code: Total files = 226 Total lines = 61,863 (*.h *.c *.in)
 
 Major Changes this Release:
-- Bare Metal Recovery for Linux systems and manually for Solaris
+- Bare Metal Recovery mostly automated for Linux systems and 
+  partially automated for Solaris
 - Optimized restore, forward spaces to correct tape file and
   stops reading the archive when all files are restored.
 - Schedule permits specification of 1st, 2nd, ... week e.g.
   1st Sun ...
 
 Minor Changes this Release:
+- Allow backup of raw partitions.
 - Fixed Restore options (never,ifnewer, ...). They now work.
 - New bidirectional timed pipe mechanism for running child processes
   permits better error messages.
@@ -28,6 +30,7 @@ Minor Changes this Release:
   daemons and the console program.
 - Added a --enable-client-only    option that will cause "make" to only
   build the File daemon and the libraries it needs.
+- Documented how to save the Catalog database (with included script).
 
 Items to note:
 - Nothing in particular.
index 6bc742e278bbf60ef5d1ade3e96c423fd5a7d3c1..e7172e06030504477c6c899f6f25b40b73247c96 100644 (file)
@@ -1311,6 +1311,8 @@ AC_OUTPUT([autoconf/Make.common \
           src/filed/bacula-fd.conf \
           src/filed/win32/Makefile \
           src/cats/Makefile \
+          src/cats/make_catalog_backup \
+          src/cats/delete_catalog_backup \
           src/cats/alter_mysql_tables \
           src/cats/make_mysql_tables \
           src/cats/drop_mysql_tables \
@@ -1340,6 +1342,7 @@ cd ..
 chmod 755 src/cats/make_mysql_tables src/cats/drop_mysql_tables
 chmod 755 src/cats/make_test_tables src/cats/drop_test_tables
 chmod 755 src/cats/create_mysql_database 
+chmod 755 src/cats/make_catalog_backup src/cats/delete_catalog_backup
 chmod 755 src/cats/alter_mysql_tables
 chmod 755 src/cats/grant_mysql_privileges
 chmod 755 src/cats/make_sqlite_tables src/cats/drop_sqlite_tables 
index 01cb5fbe060804ad2dfe55c7b385331f6b3b318e..a62ae40943f4b3e5ff7887d2c700063487e2b68b 100755 (executable)
@@ -9469,6 +9469,8 @@ trap 'rm -fr `echo "autoconf/Make.common \
           src/filed/bacula-fd.conf \
           src/filed/win32/Makefile \
           src/cats/Makefile \
+          src/cats/make_catalog_backup \
+          src/cats/delete_catalog_backup \
           src/cats/alter_mysql_tables \
           src/cats/make_mysql_tables \
           src/cats/drop_mysql_tables \
@@ -9728,6 +9730,8 @@ CONFIG_FILES=\${CONFIG_FILES-"autoconf/Make.common \
           src/filed/bacula-fd.conf \
           src/filed/win32/Makefile \
           src/cats/Makefile \
+          src/cats/make_catalog_backup \
+          src/cats/delete_catalog_backup \
           src/cats/alter_mysql_tables \
           src/cats/make_mysql_tables \
           src/cats/drop_mysql_tables \
@@ -9933,6 +9937,7 @@ cd ..
 chmod 755 src/cats/make_mysql_tables src/cats/drop_mysql_tables
 chmod 755 src/cats/make_test_tables src/cats/drop_test_tables
 chmod 755 src/cats/create_mysql_database 
+chmod 755 src/cats/make_catalog_backup src/cats/delete_catalog_backup
 chmod 755 src/cats/alter_mysql_tables
 chmod 755 src/cats/grant_mysql_privileges
 chmod 755 src/cats/make_sqlite_tables src/cats/drop_sqlite_tables 
index a38879fbfc526cd0e530539021c5949827f91e45..b8c7bc9461fd37466ebad927c6f13c3689a2f45b 100644 (file)
@@ -20,6 +20,9 @@ For 1.28 release:
 - Backup of raw partitions
 
 For 1.29 release:
+- Implement SHA1
+- Implement disk spooling
+- Implement finer multiprocessing options.
 - Solaris -I on tar for include list
 - Add whereln to where or not where absolute links
 - Figure out some way to automatically backup all local partitions
index 7bda0a6ab475ffe6ed0d915ab7d5e2b11211e477..c3a8af7807975cfc92e05729369eeb7d09e0d8de 100644 (file)
@@ -63,6 +63,7 @@ realclean: clean
        $(RMF) make_mysql_tables grant_mysql_privileges drop_mysql_tables
        $(RMF) create_mysql_database make_sqlite_tables sqlite
        $(RMF) create_bdb_database drop_bdb_tables make_dbd_tables
+       $(RMF) make_catalog_backup delete_catalog_backup
 
 distclean: realclean
        if test $(srcdir) = .; then $(MAKE) realclean; fi
@@ -74,6 +75,8 @@ install:
        $(INSTALL_SCRIPT) make_@DB_NAME@_tables $(DESTDIR)$(sysconfdir)/make_@DB_NAME@_tables
        $(INSTALL_SCRIPT) drop_bacula_tables $(DESTDIR)$(sysconfdir)/drop_bacula_tables
        $(INSTALL_SCRIPT) make_bacula_tables $(DESTDIR)$(sysconfdir)/make_bacula_tables
+       $(INSTALL_SCRIPT) make_catalog_backup $(DESTDIR)$(sysconfdir)/make_catalog_backup  
+       $(INSTALL_SCRIPT) delete_catalog_backup $(DESTDIR)$(sysconfdir)/delete_catalog_backup  
 
 uninstall:
        (cd $(DESTDIR)$(sysconfdir); $(RMF) create_@DB_NAME@_database)
@@ -81,6 +84,8 @@ uninstall:
        (cd $(DESTDIR)$(sysconfdir); $(RMF) make_@DB_NAME@_tables)
        (cd $(DESTDIR)$(sysconfdir); $(RMF) drop_bacula_tables)
        (cd $(DESTDIR)$(sysconfdir); $(RMF) make_bacula_tables)
+       (cd $(DESTDIR)$(sysconfdir); $(RMF) make_catalog_backup)
+       (cd $(DESTDIR)$(sysconfdir); $(RMF) delete_catalog_backup)
 
 
 # Semi-automatic generation of dependencies:
diff --git a/bacula/src/cats/delete_catalog_backup.in b/bacula/src/cats/delete_catalog_backup.in
new file mode 100755 (executable)
index 0000000..afeeb79
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+#
+# This script deletes a catalog dump
+#
+rm -f @working_dir@/bacula.sql
diff --git a/bacula/src/cats/make_catalog_backup.in b/bacula/src/cats/make_catalog_backup.in
new file mode 100755 (executable)
index 0000000..8cd1aba
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/sh
+#
+# This script dumps your Bacula catalog in ASCII format
+#  It works for either MySQL or SQLite
+#
+cd @working_dir@
+rm -f bacula.sql
+if test xsqlite = x@DB_NAME@ ; then
+echo ".dump" | @SQL_BINDIR@/sqlite bacula.db >bacula.sql
+else
+@SQL_BINDIR@/mysqldump -f --opt bacula >bacula.sql
+fi
+#
+#  To read back a MySQL database use: 
+#     cd @working_dir@
+#     rm -f @SQL_BINDIR@/../var/bacula/*
+#     mysql <bacula.sql
+#
+#  To read back a SQLite database use:
+#     cd @working_dir@
+#     rm -f bacula.db
+#     sqlite bacula.db <bacula.sql
+#
index 2fde3b5c9b0572bc2e937adb28adc5701b71509f..9ecd15aeacfb639fe09234f48a1982b4f9fd7cab 100644 (file)
@@ -24,7 +24,7 @@ Director {                            # define myself
   Messages = Standard
 }
 
-# Define the backup Job
+# Define the main nightly save backup job
 Job {
   Name = "NightlySave"
   Type = Backup
@@ -36,6 +36,22 @@ Job {
   Pool = Default
 }
 
+# Backup the catalog database (after the nightly save)
+Job {
+  Name = "BackupCatalog"
+  Type = Backup
+  Client=@hostname@-fd 
+  FileSet="Catalog"
+  Schedule = "WeeklyCycleAfterBackup"
+  Storage = DLTDrive
+  Messages = Standard
+  Pool = Default
+  # This creates an ASCII copy of the catalog
+  RunBeforeJob = "@sysconfdir@/make_catalog_backup"
+  # This deletes the copy of the catalog
+  RunAfterJob  = "@sysconfdir@/delete_catalog_backup"
+}
+
 # Standard Restore template, to be changed by Console program
 Job {
   Name = "RestoreFiles"
@@ -67,13 +83,32 @@ FileSet {
   Exclude = { }
 }
 
-# When to do the backups
+#
+# When to do the backups, full backup on first sunday of the month,
+#  differential (i.e. incremental since full) every other sunday,
+#  and incremental backups other days
 Schedule {
   Name = "WeeklyCycle"
-  Run = Full sun at 1:05
+  Run = Full 1st sun at 1:05
+  Run = Differential 2nd-5th sun at 1:05
   Run = Incremental mon-sat at 1:05
 }
 
+# This schedule does the catalog. It starts after the WeeklyCycle
+Schedule {
+  Name = "WeeklyCycleAfterBackup
+  Run = Full sun-sat at 1:10
+}
+
+# This is the backup of the catalog
+FileSet {
+  Name = "Catalog"
+  Include = signature=MD5 {
+     @working_directory@/bacula.sql
+  }
+}
+
+
 # Client (File Services) to backup
 Client {
   Name = @hostname@-fd
index 7afda206d9e40e1948882d2d09054a67e36df030..2f9ca4854ec677fde9fa6387985ae56c63531c37 100644 (file)
@@ -542,7 +542,7 @@ next_run:
             strcpy(buf, "      hour=");
            for (i=0; i<24; i++) {
               if (bit_is_set(i, run->hour)) {
-                  sprintf(num, "%d ", i+1);
+                  sprintf(num, "%d ", i);
                  strcat(buf, num);
               }
            }
@@ -575,6 +575,15 @@ next_run:
            }
             strcat(buf, "\n");
            sendit(sock, buf);
+            strcpy(buf, "      wpos=");
+           for (i=0; i<5; i++) {
+              if (bit_is_set(i, run->wpos)) {
+                  sprintf(num, "%d ", i+1);
+                 strcat(buf, num);
+              }
+           }
+            strcat(buf, "\n");
+           sendit(sock, buf);
             sendit(sock, "      mins=%d\n", run->minute);
            if (run->pool) {
                sendit(sock, "     --> ");
index cdea6d75d007120a21d3e2edc883ace98e3e3f57..77a7be2540cd619f3b00d372691fc89c64e57f40 100644 (file)
@@ -352,13 +352,19 @@ static void do_client_status(UAContext *ua, CLIENT *client)
    return;  
 }
 
-static void prt_runtime(UAContext *ua, JOB *job, time_t runtime)
+static void prt_runhdr(UAContext *ua)
+{
+   bsendmsg(ua, _("Level          Type     Scheduled          Name\n"));
+   bsendmsg(ua, _("=================================================================\n"));
+}
+
+static void prt_runtime(UAContext *ua, JOB *job, int level, time_t runtime)
 {
    char dt[MAX_TIME_LENGTH];      
 
    bstrftime(dt, sizeof(dt), runtime);
-   bsendmsg(ua, _("%s job \"%s\" scheduled for %s\n"), 
-      job_type_to_str(job->JobType), job->hdr.name, dt);
+   bsendmsg(ua, _("%-14s %-8s %-18s %s\n"), 
+      level_to_str(level), job_type_to_str(job->JobType), dt, job->hdr.name);
 }
 
 /*         
@@ -375,6 +381,8 @@ static void print_jobs_scheduled(UAContext *ua)
    int mday, wday, month, wpos, tmday, twday, tmonth, twpos, i, hour;
    int tod, tom;
    int found;
+   int hdr_printed = FALSE;
+   int level;
 
    Dmsg0(200, "enter find_runs()\n");
 
@@ -395,11 +403,15 @@ static void print_jobs_scheduled(UAContext *ua)
    /* Loop through all jobs */
    LockRes();
    for (job=NULL; (job=(JOB *)GetNextRes(R_JOB, (RES *)job)); ) {
+      level = job->level;   
       sched = job->schedule;
       if (sched == NULL) {           /* scheduled? */
         continue;                    /* no, skip this job */
       }
       for (run=sched->run; run; run=run->next) {
+        if (run->level) {
+           level = run->level;
+        }
         /* 
          * Find runs in next 24 hours
          */
@@ -422,7 +434,11 @@ static void print_jobs_scheduled(UAContext *ua)
                  tm.tm_sec = 0;
                  runtime = mktime(&tm);
                  if (runtime > now) {
-                    prt_runtime(ua, job, runtime);
+                    if (!hdr_printed) {
+                       hdr_printed = TRUE;
+                       prt_runhdr(ua);
+                    }
+                    prt_runtime(ua, job, level, runtime);
                     found = TRUE;
                     break;
                  }
@@ -446,7 +462,11 @@ static void print_jobs_scheduled(UAContext *ua)
            runtime = mktime(&tm);
             Dmsg2(200, "truntime=%d now=%d\n", runtime, now);
            if (runtime < tomorrow) {
-              prt_runtime(ua, job, runtime);
+              if (!hdr_printed) {
+                 hdr_printed = TRUE;
+                 prt_runhdr(ua);
+              }
+              prt_runtime(ua, job, level, runtime);
            }
         }
       }