$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.
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
+
#!/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 <<!
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.
!
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
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