Re: Instalation batch file

From: Zlatko Matić <zlatko(dot)matic1(at)sb(dot)t-com(dot)hr>
To: "Glenn Davy" <gdavy(at)tpg(dot)com(dot)au>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Instalation batch file
Date: 2005-08-05 08:59:57
Message-ID: 024b01c599a0$61ed83e0$52bffea9@zlatkovyfkpgz6
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thank you for answer. It seems that %HOMEDRIVE% is just enough to solve this
problem.
Thanks.

----- Original Message -----
From: "Glenn Davy" <gdavy(at)tpg(dot)com(dot)au>
To: "Zlatko Matić" <zlatko(dot)matic1(at)sb(dot)t-com(dot)hr>
Cc: <pgsql-general(at)postgresql(dot)org>
Sent: Thursday, August 04, 2005 12:15 AM
Subject: Re: [GENERAL] Instalation batch file

On Wed, 2005-08-03 at 23:29 +0200, Zlatko Matić wrote:
> Hello.
>
> I would like to install database schema on a server using files with
> dumped schema and globals (produced by dumpall), that are placed on
> CD. The installation script (batch file) that restores these two files
> is also placed on the same CD, (let's say E:) in the same folder.
>
> cd C:\Program Files\PostgreSQL\8.0\bin
> psql -f E:\MYBASE_SHEMA.dumpall template1 -U zmatic
> psql -f E:\MYBASE_SHEMA.dumpall template1 -U zmatic
> vacuumdb -d MYBASE -U zmatic
>
> But, what if CD is F: or some other unit ?
> How could I change this batch file (Windows XP) to be able to
> recognize what is the actual path of the folder that containes these
> three files ?

Im not sure how to determine the path to the media (esp if more than one
cd/dvd), but you could take a couple of different approaches:
1)that is to run the script from the cd drive and build the path to pg's
bin with %HOMEDRIVE%. Type 'SET' to see what other shell variables
there are
2) Run the script from anywhere and take %1 type command line paramaters
to ask location of either bin and/or cd/dvd

Been years since I've had the misfortune to have to use windows shell
scipts, but there are prob many other approachs - best to do a little
research into windows shell scripting and determine best for your
scenario.

Glenn
>
> Thanks in advance,
>
> Zlatko

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David Goodenough 2005-08-05 09:08:42 Does preparing statements other than selects help performance?
Previous Message Emilian Ursu 2005-08-05 07:47:19 Re: Postgresql Hosting