#!/bin/bash

JAVA_HOME=
JAVA="$JAVA_HOME/bin/java"
LIB="./DBManagerCmdLine.jar"

DBFOLDERPATH=
ZIPFOLDER=
ZIPNAME=
DPDUMPFOLDERPATH=

#SQLSCRIPTPATH=

ORACLEADMINACCOUNTNAME="SYSTEM"
ORACLEADMINACCOUNTPWD="SYSTEM"
#ORACLEADMINACCOUNTPWDFILE=
DPDUMPONLY="false"
SAVEWEBAPPS="true"
SAVEJRE="true"

DATENOW=$(date +"%d-%m-%y-%Hh%M")
ZIPFILEPATH="$ZIPFOLDER$ZIPNAME-${DATENOW}.zip"

CMD="$JAVA -cp $LIB db.manager.cmd.DBSaveCmd"
CMD="$CMD -dbfolderpath $DBFOLDERPATH"
CMD="$CMD -zipfilepath $ZIPFILEPATH"
CMD="$CMD -dpdumpfolderpath $DPDUMPFOLDERPATH"
CMD="$CMD -oracleadminaccountname $ORACLEADMINACCOUNTNAME"
# Password directly written in script (not safe)
CMD="$CMD -oracleadminaccountpwd $ORACLEADMINACCOUNTPWD"
# or use encrypted password in file (see pwd.ps1)
#CMD="$CMD -oracleadminaccountpwdfile $ORACLEADMINACCOUNTPWDFILE"
CMD="$CMD -dpdumponly $DPDUMPONLY"
#CMD="$CMD -savewebapps $SAVEWEBAPPS"
#CMD="$CMD -savejre $SAVEJRE"
#CMD="$CMD -sqlscriptpath '$SQLSCRIPTPATH'"

$CMD

