source: TI01-discovery-Ingest/trunk/v4.3.0/ingestAutomation-upgrade/ingestLoggingDatabase/create_database.sh @ 7239

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI01-discovery-Ingest/trunk/v4.3.0/ingestAutomation-upgrade/ingestLoggingDatabase/create_database.sh@7239
Revision 7239, 460 bytes checked in by sdonegan, 9 years ago (diff)

Initial commit of ingest & logging database create scripts

Line 
1#!/bin/bash
2
3if [ $# -lt 2 ]
4then
5         echo 1>&2 Usage: $0 username database [hostname] [port]
6         echo 1>&2 - hostname defaults to 'localhost'
7         echo 1>&2 - port defaults to 5432
8         exit 127
9fi
10
11port="5432"
12if [ $# -gt 3 ]
13then
14        port=$4
15fi
16
17host="localhost"
18if [ $# -gt 2 ]
19then
20        host=$3
21fi
22
23dbOptions="-U $1 -d $2 -h $host -p $port"
24echo $dbOptions
25
26psql -f HarvestLoggingTables.sql $dbOptions
27psql -f IngestLoggingTable.sql $dbOptions
Note: See TracBrowser for help on using the repository browser.