From 71a32a5f670acb2d7e6e6b06083afdb2eda7788b Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 3 Mar 2008 19:55:34 +0000 Subject: [PATCH] Improve windows scripts - backup with date/time --- install/Adempiere/RUN_update.bat | 4 ++-- utils/RUN_Adempiere.bat | 3 ++- utils/RUN_DBExport.bat | 4 ++-- utils/RUN_DBStart.bat | 3 ++- utils/RUN_DBStop.bat | 3 ++- utils/RUN_Server2.bat | 5 +++-- utils/RUN_Server2Stop.bat | 6 ++++-- utils/myDBcopyTemplate.bat | 14 ++++++++------ utils/myDBcopyTemplate.sh | 1 + utils/oracle/DBExport.bat | 2 +- utils/oracleXE/DBExport.bat | 2 +- 11 files changed, 28 insertions(+), 19 deletions(-) diff --git a/install/Adempiere/RUN_update.bat b/install/Adempiere/RUN_update.bat index 404fcc2894..641facfa83 100644 --- a/install/Adempiere/RUN_update.bat +++ b/install/Adempiere/RUN_update.bat @@ -17,5 +17,5 @@ goto START :START @"%JAVA%" -classpath lib\CInstall.jar; -DADEMPIERE_HOME=%ADEMPIERE_HOME% -Dant.home="." org.apache.tools.ant.launch.Launcher update -@Rem Wait 10 second -@PING 1.1.1.1 -n 1 -w 10000 > NUL \ No newline at end of file +@Rem Sleep 10 +@CHOICE /C YN /T 10 /D N > NUL \ No newline at end of file diff --git a/utils/RUN_Adempiere.bat b/utils/RUN_Adempiere.bat index 2ad6ee55de..85c3c095c9 100644 --- a/utils/RUN_Adempiere.bat +++ b/utils/RUN_Adempiere.bat @@ -51,4 +51,5 @@ set ADEMPIERE_HOME=%~dp0.. :START @"%JAVA%" -Xms32m -Xmx512m -DADEMPIERE_HOME=%ADEMPIERE_HOME% %PROP% %SECURE% -classpath "%CLASSPATH%" org.compiere.Adempiere -@sleep 15 \ No newline at end of file +@Rem @sleep 15 +@CHOICE /C YN /T 15 /D N > NUL \ No newline at end of file diff --git a/utils/RUN_DBExport.bat b/utils/RUN_DBExport.bat index c7e2679c59..ae67386b92 100644 --- a/utils/RUN_DBExport.bat +++ b/utils/RUN_DBExport.bat @@ -11,5 +11,5 @@ @Echo If the following statement fails, fix your environment IF (%ADEMPIERE_HOME%) == () (CALL myDBcopy.bat) else (CALL %ADEMPIERE_HOME%\utils\myDBcopy.bat) -@Echo Sleeping ... (remove command if you are on XP) -@sleep 60 +@Rem Sleep 60 +@CHOICE /C YN /T 60 /D N > NUL \ No newline at end of file diff --git a/utils/RUN_DBStart.bat b/utils/RUN_DBStart.bat index 57b5e1e9e4..ab393389d1 100644 --- a/utils/RUN_DBStart.bat +++ b/utils/RUN_DBStart.bat @@ -6,4 +6,5 @@ @CALL %ADEMPIERE_DB_PATH%\Start.bat @Echo Done starting database %ADEMPIERE_HOME% (%ADEMPIERE_DB_NAME%) -@sleep 60 +@Rem Sleep 60 +@CHOICE /C YN /T 60 /D N > NUL \ No newline at end of file diff --git a/utils/RUN_DBStop.bat b/utils/RUN_DBStop.bat index c76da3ff7f..9012cd7748 100644 --- a/utils/RUN_DBStop.bat +++ b/utils/RUN_DBStop.bat @@ -6,4 +6,5 @@ @CALL %ADEMPIERE_DB_PATH%\Stop.bat @Echo Done stopping database %ADEMPIERE_HOME% (%ADEMPIERE_DB_NAME%) -@sleep 60 +@Rem Sleep 60 +@CHOICE /C YN /T 60 /D N > NUL \ No newline at end of file diff --git a/utils/RUN_Server2.bat b/utils/RUN_Server2.bat index 91f6a2e1c0..bc61d8db08 100644 --- a/utils/RUN_Server2.bat +++ b/utils/RUN_Server2.bat @@ -25,6 +25,7 @@ @Echo Apps Server start of %ADEMPIERE_APPS_TYPE% not supported :END -@Sleep 60 -@Exit +@Rem Sleep 60 +@CHOICE /C YN /T 60 /D N > NUL +@Exit \ No newline at end of file diff --git a/utils/RUN_Server2Stop.bat b/utils/RUN_Server2Stop.bat index bfc74f8d1e..db90ce0428 100644 --- a/utils/RUN_Server2Stop.bat +++ b/utils/RUN_Server2Stop.bat @@ -22,5 +22,7 @@ Call shutdown --server=jnp://%ADEMPIERE_APPS_SERVER%:%ADEMPIERE_JNP_PORT% --shut @Echo Apps Server stop of %ADEMPIERE_APPS_TYPE% not supported :END -@sleep 30 -@Exit +@Rem Sleep 30 +@CHOICE /C YN /T 30 /D N > NUL + +@Exit \ No newline at end of file diff --git a/utils/myDBcopyTemplate.bat b/utils/myDBcopyTemplate.bat index 96ee082c40..62457ac62e 100644 --- a/utils/myDBcopyTemplate.bat +++ b/utils/myDBcopyTemplate.bat @@ -3,7 +3,7 @@ @Echo Modify the script myDBcopy to copy the database backup -@Rem This example creates one inique file per day in a month +@Rem This example creates one unique file per day in a month @Rem You may want to copy it to another disk first @Rem Note that the %DATE% parameter is local specific. @Rem In Germany, it is %DATE:~3,2% @@ -12,10 +12,12 @@ @Rem %ADEMPIERE_HOME%\data\ExpDat.log @Rem %ADEMPIERE_HOME%\data\ExpDat.jar (containing the above) -@Echo Creating ExpDat_%DATE:~7,2%.jar -jar cvfM ExpDat_%DATE:~7,2%.jar %ADEMPIERE_HOME%\data\ExpDat.dmp -@dir ExpDat_%DATE:~7,2%.jar +@set DATETIME=%date:~6,4%%date:~3,2%%date:~0,2%_%TIME:~0,2%%TIME:~3,2%%TIME:~6,2% +@Echo Creating ExpDat_%DATETIME%.jar +ren ExpDat.jar ExpDat%DATETIME%.jar +@dir ExpDat%DATETIME%.jar -@Echo Copy comes here ... +@Echo copy %ADEMPIERE_HOME%\data\ExpDat%DATETIME%.jar to backup media -@sleep 30 \ No newline at end of file +@Rem Sleep 30 +@CHOICE /C YN /T 30 /D N > NUL \ No newline at end of file diff --git a/utils/myDBcopyTemplate.sh b/utils/myDBcopyTemplate.sh index b4b66a8428..839665f626 100644 --- a/utils/myDBcopyTemplate.sh +++ b/utils/myDBcopyTemplate.sh @@ -5,3 +5,4 @@ DATE=`date +%Y%m%d_%H%M%S` mv $ADEMPIERE_HOME/data/ExpDat.jar $ADEMPIERE_HOME/data/ExpDat$DATE.jar echo copy $ADEMPIERE_HOME/data/ExpDat$DATE.jar to backup media +sleep 30 \ No newline at end of file diff --git a/utils/oracle/DBExport.bat b/utils/oracle/DBExport.bat index 4ebdc81020..54566e63bf 100644 --- a/utils/oracle/DBExport.bat +++ b/utils/oracle/DBExport.bat @@ -10,7 +10,7 @@ @Rem Must have parameter: userAccount @if (%1) == () goto usage -@Rem Clanup +@Rem Cleanup @sqlplus %1/%2@%ADEMPIERE_DB_SERVER%/%ADEMPIERE_DB_NAME% @%ADEMPIERE_HOME%\utils\%ADEMPIERE_DB_PATH%\Daily.sql @Rem The Export diff --git a/utils/oracleXE/DBExport.bat b/utils/oracleXE/DBExport.bat index 4ebdc81020..54566e63bf 100644 --- a/utils/oracleXE/DBExport.bat +++ b/utils/oracleXE/DBExport.bat @@ -10,7 +10,7 @@ @Rem Must have parameter: userAccount @if (%1) == () goto usage -@Rem Clanup +@Rem Cleanup @sqlplus %1/%2@%ADEMPIERE_DB_SERVER%/%ADEMPIERE_DB_NAME% @%ADEMPIERE_HOME%\utils\%ADEMPIERE_DB_PATH%\Daily.sql @Rem The Export