9 # If we're on an Easy Install system, use our own db_ tools.
11 if [ -x /usr/local/ctdlsupport/bin/db_dump ] ; then
12 export PATH=/usr/local/ctdlsupport/bin:$PATH
20 Citadel Database Cleanup
21 ---------------------------
23 This script exports, deletes, and re-imports your database. If you have
24 any data corruption issues, this program may be able to clean them up for you.
26 Please note that this program does a Berkeley DB dump/load, not a Citadel
27 export. The export files are not generated by the Citadel export module.
30 MAKE A BACKUP OF YOUR DATA BEFORE ATTEMPTING THIS. There is no guarantee
34 citserver must NOT be running while you do this.
37 Please try "db_recover -c" from the data/ directory first. Use this tool
38 only if that one fails to fix your problem.
41 You must have an amount of free space on your disk that is at least twice
42 the size of your database.
46 echo -n "Do you want to continue? "
50 "y" | "Y" | "yes" | "YES" | "Yes" )
52 echo DO NOT INTERRUPT THIS PROCESS.
59 for x in 00 01 02 03 04 05 06 07 08 09 0a
62 echo Dumping $filename
63 db_dump -h ./data $filename >/tmp/CitaDump.$x || die
64 rm -f ./data/$filename
67 echo Removing old databases
70 for x in 00 01 02 03 04 05 06 07 08 09
73 echo Loading $filename
74 db_load -h ./data $filename </tmp/CitaDump.$x && {
75 rm -f /tmp/CitaDump.$x
80 echo Dump/load operation complete. Start your Citadel server now.