]> andersk Git - moira.git/blame - db/renamedb
Used /bin/sh format instead of /bin/csh format, by accident.
[moira.git] / db / renamedb
CommitLineData
4d77806d 1#! /bin/sh
2
3# $Header$
4#
5# Ingres does not come with a utility to rename a database, so we do
6# it this way. First, rename the directory containing the datafiles.
7# Then run the program to restore after a system crash. It will cause
8# the dbdb directory to match where the files are, renaming the
9# database.
10
11if (test $# != 2) then
12 echo Usage: $0 oldname newname
13 exit 1
14fi
15
16OLDNAME=$1
17NEWNAME=$2
18INGRES=/usr/rtingres/data/default
19
20if (test ! -d $INGRES/$OLDNAME) then
21 echo Database $OLDNAME does not exist!
22 exit 1
23fi
24
25if (test -r $INGRES/$NEWNAME) then
26 echo Database $NEWNAME already exists!
27 exit 1
28fi
29
30if (mv $INGRES/$OLDNAME $INGRES/$NEWNAME) then
31 true
32else
33 echo Unable to move database
34 exit 1
35fi
36
37echo | /usr/rtingres/bin/finddbs -r
This page took 0.191906 seconds and 5 git commands to generate.