]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/tools/dbcheck.c
kes Make bat have 'make install' target.
[bacula/bacula] / bacula / src / tools / dbcheck.c
index 4e5eee8aabbf7133e8bbe443f480aea9fd551992..149bd5e9811e72cad81020d3633e4238fe9a8ba7 100644 (file)
@@ -1,13 +1,3 @@
-/*
- *
- *  Program to check a Bacula database for consistency and to
- *   make repairs
- *
- *   Kern E. Sibbald, August 2002
- *
- *   Version $Id$
- *
- */
 /*
    Bacula® - The Network Backup Solution
 
    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
    Switzerland, email:ftf@fsfeurope.org.
 */
+/*
+ *
+ *  Program to check a Bacula database for consistency and to
+ *   make repairs
+ *
+ *   Kern E. Sibbald, August 2002
+ *
+ *   Version $Id$
+ *
+ */
 
 #include "bacula.h"
 #include "cats/cats.h"
@@ -732,6 +732,8 @@ static void eliminate_orphaned_jobmedia_records()
       if (fix && id_list.num_ids > 0) {
          printf(_("Deleting %d orphaned JobMedia records.\n"), id_list.num_ids);
          delete_id_list("DELETE FROM JobMedia WHERE JobMediaId=%s", &id_list);
+      } else {
+         break;                       /* get out if not updating db */
       }
       if (!make_id_list(query, &id_list)) {
          exit(1);
@@ -773,6 +775,8 @@ static void eliminate_orphaned_file_records()
       if (fix && id_list.num_ids > 0) {
          printf(_("Deleting %d orphaned File records.\n"), id_list.num_ids);
          delete_id_list("DELETE FROM File WHERE FileId=%s", &id_list);
+      } else {
+         break;                       /* get out if not updating db */
       }
       if (!make_id_list(query, &id_list)) {
          exit(1);
@@ -810,6 +814,8 @@ static void eliminate_orphaned_path_records()
       if (fix && id_list.num_ids > 0) {
          printf(_("Deleting %d orphaned Path records.\n"), id_list.num_ids);
          delete_id_list("DELETE FROM Path WHERE PathId=%s", &id_list);
+      } else {
+         break;                       /* get out if not updating db */
       }
       if (!make_id_list(query, &id_list)) {
          exit(1);
@@ -847,6 +853,8 @@ static void eliminate_orphaned_filename_records()
       if (fix && id_list.num_ids > 0) {
          printf(_("Deleting %d orphaned Filename records.\n"), id_list.num_ids);
          delete_id_list("DELETE FROM Filename WHERE FilenameId=%s", &id_list);
+      } else {
+         break;                       /* get out if not updating db */
       }
       if (!make_id_list(query, &id_list)) {
          exit(1);