+++ /dev/null
-#!/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 <<!
-
-Citadel 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.
-
-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.
-
-WARNING #4:
- You must have an amount of free space on your disk that is at least twice
- the size of your database.
-
-!
-
-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 08 09 0a
-do
- filename=cdb.$x
- echo Dumping $filename
- db_dump -h ./data $filename >/tmp/CitaDump.$x || die
- rm -f ./data/$filename
-done
-
-echo Removing old databases
-rm -f ./data/*
-
-for x in 00 01 02 03 04 05 06 07 08 09
-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