gnumed-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnumed-devel] Problems dumping database (Mac limitation on su -c)


From: Karsten Hilbert
Subject: Re: [Gnumed-devel] Problems dumping database (Mac limitation on su -c)
Date: Thu, 26 May 2011 18:38:26 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Tue, May 24, 2011 at 11:23:32PM -0700, Jim Busser wrote:

> sh ./gm-backup_database.sh
> 
> if ! su -c "psql -t -l -p ${GM_PORT}" -l postgres | grep -q 
> "^[[:space:]]*${GM_DATABASE}" ; then
>       echo "The configuration in ${CONF} is set to backup"
>       echo "the GNUmed database ${GM_DATABASE}. This"
>       echo "database does not exist, however. Aborting."
>       exit 1
> fi
> 
> so I then tried again, after disabling the above "sanity check code" and ran 
> into different problems. My questions are:
> 
> 1) is there any suggested workaround method of achieving the above sanity 
> check on Mac which maybe needs splitting into extra lines or clauses?

The suggested workaround would be to modify the usage of su
to what Mac is decreeing to be The Way.

Splitting is unlikely to help as it won't get rid of the -c.

> 2) is any of the trouble below a function of whether or
> not the system account postgres is allowed to read and/or
> write to the directory from which the dump is being called
> and.or the directory in which the dump files would be
> written?

Not very likely, I would think.

> MacBook-2:server root# sh ./gm-backup_database.sh
> could not identify current directory: Permission denied
> psql: warning: extra command-line argument "name," ignored
> psql: warning: extra command-line argument "for" ignored
> psql: warning: extra command-line argument "example" ignored
> psql: warning: extra command-line argument "gnumed_v15" ignored

This very much hints at improper formatting within the shell
script. Can you post the exact script which produces this
output ?

Karsten
-- 
GPG key ID E4071346 @ gpg-keyserver.de
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346



reply via email to

[Prev in Thread] Current Thread [Next in Thread]