source: tags/ms_r16q3/SH/arb_repair

Last change on this file was 8946, checked in by westram, 12 years ago
  • added parameter -r to arb_2_ascii
    • only run in recovery mode when -r is specified
  • changed recovery-mode-messages in ARBDB
  • parse and name parameters in arb_repair
  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.1 KB
Line 
1#!/bin/bash
2
3main() {
4    if [ -z "$2" ]; then
5        echo "Usage: arb_repair database outputdatabase [-m] [-r] [-c[tree_xxx]]"
6        echo "       -m            create map file too"
7        echo "       -r            try to repair invalid database"
8        echo "       -c[tree_xxx]  optimize database using tree_xxx or largest tree"
9    else
10        local IN=$1
11        local OUT=$2
12
13        shift 2
14
15        local MAPFILE=
16        local RECOVER=
17        local OPTIMIZE=
18
19        while [ ! -z "$1" ]; do
20            if [ "$1" = "-m" ]; then
21                MAPFILE=$1
22                shift
23            else
24                if [ "$1" = "-r" ]; then
25                    RECOVER=$1
26                    shift
27                else
28                    OPTIMIZE=$1
29                    shift
30                fi
31            fi
32        done
33
34        echo "arb_repair: Repairing database $IN .."
35        echo ""
36        echo "Running 'arb_2_ascii $RECOVER $IN - | arb_2_bin $MAPFILE $RECOVER $OPTIMIZE - $OUT'"
37        arb_2_ascii $RECOVER $IN - | arb_2_bin $MAPFILE $RECOVER $OPTIMIZE - $OUT
38        ls -al $IN $OUT
39    fi
40}
41
42main $*
Note: See TracBrowser for help on using the repository browser.