2008-11-05 20:09:05 +07:00
|
|
|
#!/bin/sh
|
|
|
|
|
2006-11-17 10:14:43 +07:00
|
|
|
echo Adempiere Database Export $Revision: 1.5 $
|
|
|
|
|
|
|
|
# $Id: DBExport.sh,v 1.5 2005/12/20 07:12:17 jjanke Exp $
|
|
|
|
|
|
|
|
echo Saving database $1@$ADEMPIERE_DB_NAME to $ADEMPIERE_HOME/data/ExpDat.dmp
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
# Cleanup
|
2008-08-23 04:27:20 +07:00
|
|
|
sqlplus $1/$2@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME @$ADEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/Daily.sql
|
2006-11-17 10:14:43 +07:00
|
|
|
|
|
|
|
# Export
|
2008-08-23 04:27:20 +07:00
|
|
|
exp $1/$2@$ADEMPIERE_DB_SERVER:$ADEMPIERE_DB_PORT/$ADEMPIERE_DB_NAME FILE=$ADEMPIERE_HOME/data/ExpDat.dmp Log=$ADEMPIERE_HOME/data/ExpDat.log CONSISTENT=Y OWNER=$1
|
2006-11-17 10:14:43 +07:00
|
|
|
|
|
|
|
cd $ADEMPIERE_HOME/data
|
|
|
|
jar cvfM ExpDat.jar ExpDat.dmp ExpDat.log
|