2006-11-17 10:14:43 +07:00
|
|
|
echo Adempiere PostgreSQL Database Export $Revision: 1.3 $
|
|
|
|
|
|
|
|
# $Id: DBExport.sh,v 1.3 2005/01/22 21:59:15 jjanke Exp $
|
|
|
|
|
2006-12-28 15:33:33 +07:00
|
|
|
echo Saving database $1@$ADEMPIERE_DB_NAME to $ADEMPIERE_HOME/data/ExpDat.dmp
|
2006-11-17 10:14:43 +07:00
|
|
|
|
2006-12-28 15:33:33 +07:00
|
|
|
if [ $# -eq 0 ]
|
|
|
|
then
|
|
|
|
echo "Usage: $0 <userAccount>"
|
|
|
|
echo "Example: $0 adempiere adempiere"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
if [ "$ADEMPIERE_HOME" = "" -o "$ADEMPIERE_DB_NAME" = "" ]
|
|
|
|
then
|
|
|
|
echo "Please make sure that the environment variables are set correctly:"
|
|
|
|
echo " ADEMPIERE_HOME e.g. /Adempiere"
|
|
|
|
echo " ADEMPIERE_DB_NAME e.g. adempiere.adempiere.org"
|
|
|
|
exit 1
|
|
|
|
fi
|
2006-11-17 10:14:43 +07:00
|
|
|
|
2007-09-05 15:01:55 +07:00
|
|
|
export PGPASSWORD=$2
|
2007-04-13 07:11:06 +07:00
|
|
|
pg_dump -U $1 $ADEMPIERE_DB_NAME > $ADEMPIERE_HOME/data/ExpDat.dmp
|
2007-09-05 15:01:55 +07:00
|
|
|
export PGPASSWORD=
|
2006-12-28 15:33:33 +07:00
|
|
|
|
|
|
|
cd $ADEMPIERE_HOME/data
|
|
|
|
jar cvfM ExpDat.jar ExpDat.dmp ExpDat.log
|