]> code.citadel.org Git - citadel.git/commitdiff
* database_cleanup.sh: look for /usr/local/ctdlsupport/bin/db_dump and
authorArt Cancro <ajc@citadel.org>
Sun, 27 Feb 2005 15:36:28 +0000 (15:36 +0000)
committerArt Cancro <ajc@citadel.org>
Sun, 27 Feb 2005 15:36:28 +0000 (15:36 +0000)
  prepend that directory to the PATH if found.
* database_cleanup.sh: add more warnings about how dangerous this tool is

citadel/ChangeLog
citadel/database_cleanup.sh

index a21f20909c9a9ce11de7399799859023246ffdbc..22970ad729beb8c7d4b79bc4e004d4b6e036a24d 100644 (file)
@@ -1,4 +1,9 @@
  $Log$
+ Revision 641.6  2005/02/27 15:36:28  ajc
+ * database_cleanup.sh: look for /usr/local/ctdlsupport/bin/db_dump and
+   prepend that directory to the PATH if found.
+ * database_cleanup.sh: add more warnings about how dangerous this tool is
+
  Revision 641.5  2005/02/26 16:27:54  ajc
  * setup.c: added "hula" to the list of non-Citadel MTA's which can be
    disabled during setup.
@@ -6446,3 +6451,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
+
index 41a7f5cad85b5c21d233719a3c5fdea3ce7f879b..4cd0638e760907ec3042bbdee175de2bf464209e 100755 (executable)
@@ -1,5 +1,19 @@
 #!/bin/bash
 
+die () {
+       echo Exiting.
+       exit 1
+}
+
+
+# If we're on an Easy Install system, use our own db_ tools.
+#
+if [ -x /usr/local/ctdlsupport/bin/db_dump ] ; then
+       export PATH=/usr/local/ctdlsupport/bin:$PATH
+fi
+
+# Ok, let's begin.
+#
 clear
 cat <<!
 
@@ -12,8 +26,16 @@ any data corruption issues, this program may be able to clean them up for you.
 Please note that this program does a Berkeley DB dump/load, not a Citadel
 export.  The export files are not generated by the Citadel export module.
 
-MAKE A BACKUP OF YOUR DATA BEFORE ATTEMPTING THIS.  There is no guarantee
-that this will work!
+WARNING #1:
+  MAKE A BACKUP OF YOUR DATA BEFORE ATTEMPTING THIS.  There is no guarantee
+  that this will work!
+
+WARNING #2:
+  citserver must NOT be running while you do this.
+
+WARNING #3:
+  Please try "db_recover -c" from the data/ directory first.  Use this tool
+  only if that one fails to fix your problem.
 
 !
 
@@ -34,7 +56,7 @@ for x in 00 01 02 03 04 05 06 07 08
 do
        filename=cdb.$x
        echo Dumping $filename
-       db_dump -h ./data $filename >/tmp/CitaDump.$x
+       db_dump -h ./data $filename >/tmp/CitaDump.$x || die
        rm -f ./data/$filename
 done
 
@@ -45,8 +67,9 @@ for x in 00 01 02 03 04 05 06 07 08
 do
        filename=cdb.$x
        echo Loading $filename
-       db_load -h ./data $filename </tmp/CitaDump.$x
-       rm -f /tmp/CitaDump.$x
+       db_load -h ./data $filename </tmp/CitaDump.$x && {
+               rm -f /tmp/CitaDump.$x
+       }
 done
 
 echo