Improve windows scripts - backup with date/time

This commit is contained in:
Carlos Ruiz 2008-03-03 19:55:34 +00:00
parent a6668e11b9
commit 71a32a5f67
11 changed files with 28 additions and 19 deletions

View File

@ -17,5 +17,5 @@ goto START
:START :START
@"%JAVA%" -classpath lib\CInstall.jar; -DADEMPIERE_HOME=%ADEMPIERE_HOME% -Dant.home="." org.apache.tools.ant.launch.Launcher update @"%JAVA%" -classpath lib\CInstall.jar; -DADEMPIERE_HOME=%ADEMPIERE_HOME% -Dant.home="." org.apache.tools.ant.launch.Launcher update
@Rem Wait 10 second @Rem Sleep 10
@PING 1.1.1.1 -n 1 -w 10000 > NUL @CHOICE /C YN /T 10 /D N > NUL

View File

@ -51,4 +51,5 @@ set ADEMPIERE_HOME=%~dp0..
:START :START
@"%JAVA%" -Xms32m -Xmx512m -DADEMPIERE_HOME=%ADEMPIERE_HOME% %PROP% %SECURE% -classpath "%CLASSPATH%" org.compiere.Adempiere @"%JAVA%" -Xms32m -Xmx512m -DADEMPIERE_HOME=%ADEMPIERE_HOME% %PROP% %SECURE% -classpath "%CLASSPATH%" org.compiere.Adempiere
@sleep 15 @Rem @sleep 15
@CHOICE /C YN /T 15 /D N > NUL

View File

@ -11,5 +11,5 @@
@Echo If the following statement fails, fix your environment @Echo If the following statement fails, fix your environment
IF (%ADEMPIERE_HOME%) == () (CALL myDBcopy.bat) else (CALL %ADEMPIERE_HOME%\utils\myDBcopy.bat) IF (%ADEMPIERE_HOME%) == () (CALL myDBcopy.bat) else (CALL %ADEMPIERE_HOME%\utils\myDBcopy.bat)
@Echo Sleeping ... (remove command if you are on XP) @Rem Sleep 60
@sleep 60 @CHOICE /C YN /T 60 /D N > NUL

View File

@ -6,4 +6,5 @@
@CALL %ADEMPIERE_DB_PATH%\Start.bat @CALL %ADEMPIERE_DB_PATH%\Start.bat
@Echo Done starting database %ADEMPIERE_HOME% (%ADEMPIERE_DB_NAME%) @Echo Done starting database %ADEMPIERE_HOME% (%ADEMPIERE_DB_NAME%)
@sleep 60 @Rem Sleep 60
@CHOICE /C YN /T 60 /D N > NUL

View File

@ -6,4 +6,5 @@
@CALL %ADEMPIERE_DB_PATH%\Stop.bat @CALL %ADEMPIERE_DB_PATH%\Stop.bat
@Echo Done stopping database %ADEMPIERE_HOME% (%ADEMPIERE_DB_NAME%) @Echo Done stopping database %ADEMPIERE_HOME% (%ADEMPIERE_DB_NAME%)
@sleep 60 @Rem Sleep 60
@CHOICE /C YN /T 60 /D N > NUL

View File

@ -25,6 +25,7 @@
@Echo Apps Server start of %ADEMPIERE_APPS_TYPE% not supported @Echo Apps Server start of %ADEMPIERE_APPS_TYPE% not supported
:END :END
@Sleep 60 @Rem Sleep 60
@Exit @CHOICE /C YN /T 60 /D N > NUL
@Exit

View File

@ -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 @Echo Apps Server stop of %ADEMPIERE_APPS_TYPE% not supported
:END :END
@sleep 30 @Rem Sleep 30
@CHOICE /C YN /T 30 /D N > NUL
@Exit @Exit

View File

@ -3,7 +3,7 @@
@Echo Modify the script myDBcopy to copy the database backup @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 You may want to copy it to another disk first
@Rem Note that the %DATE% parameter is local specific. @Rem Note that the %DATE% parameter is local specific.
@Rem In Germany, it is %DATE:~3,2% @Rem In Germany, it is %DATE:~3,2%
@ -12,10 +12,12 @@
@Rem %ADEMPIERE_HOME%\data\ExpDat.log @Rem %ADEMPIERE_HOME%\data\ExpDat.log
@Rem %ADEMPIERE_HOME%\data\ExpDat.jar (containing the above) @Rem %ADEMPIERE_HOME%\data\ExpDat.jar (containing the above)
@Echo Creating 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%
jar cvfM ExpDat_%DATE:~7,2%.jar %ADEMPIERE_HOME%\data\ExpDat.dmp @Echo Creating ExpDat_%DATETIME%.jar
@dir ExpDat_%DATE:~7,2%.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 @Rem Sleep 30
@CHOICE /C YN /T 30 /D N > NUL

View File

@ -5,3 +5,4 @@ DATE=`date +%Y%m%d_%H%M%S`
mv $ADEMPIERE_HOME/data/ExpDat.jar $ADEMPIERE_HOME/data/ExpDat$DATE.jar mv $ADEMPIERE_HOME/data/ExpDat.jar $ADEMPIERE_HOME/data/ExpDat$DATE.jar
echo copy $ADEMPIERE_HOME/data/ExpDat$DATE.jar to backup media echo copy $ADEMPIERE_HOME/data/ExpDat$DATE.jar to backup media
sleep 30

View File

@ -10,7 +10,7 @@
@Rem Must have parameter: userAccount @Rem Must have parameter: userAccount
@if (%1) == () goto usage @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 @sqlplus %1/%2@%ADEMPIERE_DB_SERVER%/%ADEMPIERE_DB_NAME% @%ADEMPIERE_HOME%\utils\%ADEMPIERE_DB_PATH%\Daily.sql
@Rem The Export @Rem The Export

View File

@ -10,7 +10,7 @@
@Rem Must have parameter: userAccount @Rem Must have parameter: userAccount
@if (%1) == () goto usage @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 @sqlplus %1/%2@%ADEMPIERE_DB_SERVER%/%ADEMPIERE_DB_NAME% @%ADEMPIERE_HOME%\utils\%ADEMPIERE_DB_PATH%\Daily.sql
@Rem The Export @Rem The Export