* database_cleanup.sh: added
authorArt Cancro <ajc@citadel.org>
Thu, 19 Dec 2002 04:51:49 +0000 (04:51 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 19 Dec 2002 04:51:49 +0000 (04:51 +0000)
citadel/ChangeLog
citadel/database_cleanup.sh [new file with mode: 0755]

index 945977b3d01ffe9699324c4b75af4a807d1433a8..592c5d4543b7e1bbd637c1d0df1c1bacbf60fcc8 100644 (file)
@@ -1,4 +1,7 @@
  $Log$
+ Revision 601.92  2002/12/19 04:51:49  ajc
+ * database_cleanup.sh: added
+
  Revision 601.91  2002/12/18 04:08:16  ajc
  * Don't attempt to send out invitations when there are no attendees.
 
@@ -4312,4 +4315,3 @@ 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
-
diff --git a/citadel/database_cleanup.sh b/citadel/database_cleanup.sh
new file mode 100755 (executable)
index 0000000..466c8ee
--- /dev/null
@@ -0,0 +1,54 @@
+#!/bin/bash
+
+clear
+cat <<!
+
+Citadel/UX Database Cleanup
+---------------------------
+
+This script exports, deletes, and re-imports your database.  If you have
+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!
+
+!
+
+echo -n "Do you want to continue? "
+
+read yesno
+case "$yesno" in
+       "y" | "Y" | "yes" | "YES" | "Yes" )
+               echo 
+               echo DO NOT INTERRUPT THIS PROCESS.
+               echo
+       ;;
+       * )
+               exit
+esac
+
+for x in 00 01 02 03 04 05 06 07
+do
+       filename=cdb.$x
+       echo Dumping $filename
+       db_dump -h ./data $filename >/tmp/CitaDump.$x
+       rm -f ./data/$filename
+done
+
+echo Removing log files
+rm -f ./data/*
+
+for x in 00 01 02 03 04 05 06 07
+do
+       filename=cdb.$x
+       echo Loading $filename
+       db_load -h ./data $filename </tmp/CitaDump.$x
+       rm -f /tmp/CitaDump.$x
+done
+
+echo 
+echo Dump/load operation complete.  Start your Citadel server now.
+echo