Changeset 613

Show
Ignore:
Timestamp:
06/20/06 14:41:56
Author:
johnsa
Message:

timestamped backup command now available in windows dump/restore bat file

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/calendar3/config/configs/democal.properties

    r610 r613  
    218218# -------------- normal dump/restore build properties ------------------ 
    219219 
    220 org.bedework.app.dumpres.shellscr.name=cmd 
    221 org.bedework.app.dumpres.batscr.name=cmd.bat 
     220org.bedework.app.dumpres.shellscr.name=bwrun 
     221org.bedework.app.dumpres.batscr.name=bwrun.bat 
    222222org.bedework.app.dumpres.zip.name=dumpres 
    223223org.bedework.app.dumpres.description=Bedework dump/restore utility 
     
    231231# -------------- convert from 2.3 build properties - use restore only ------------------ 
    232232 
    233 org.bedework.app.restoreFrom2p3px.shellscr.name=cmd 
    234 org.bedework.app.restoreFrom2p3px.batscr.name=cmd.bat 
     233org.bedework.app.restoreFrom2p3px.shellscr.name=bwrun 
     234org.bedework.app.restoreFrom2p3px.batscr.name=bwrun.bat 
    235235org.bedework.app.restoreFrom2p3px.zip.name=restoreFrom2p3px 
    236236org.bedework.app.restoreFrom2p3px.dumpfile=${calendar.dir}/dumprestore/initcaldata.xml 
  • trunk/calendar3/deployment/dumprestore/shellscr/resources/dumpres.bat

    r612 r613  
    1 @echo off 
    21:: Run the bedework dump/restore program 
    32:: First arg defines the action, dump, restore etc 
     
    54 
    65:: JAVA_HOME needs to be defined 
     6 
     7@echo off 
     8setlocal 
    79 
    810if not "%JAVA_HOME%"=="" goto noJavaWarn 
     
    2426SET APPNAME=@BW-APP-NAME@ 
    2527 
     28ECHO. 
     29ECHO. 
     30ECHO   Bedework Database Tools 
     31ECHO   ----------------------- 
     32ECHO. 
     33 
    2634:branch 
    2735  if "%1" == "dump" GOTO dump 
     
    3442 
    3543:usage 
    36   ECHO    ---------------------------------------- 
    37   ECHO    Usage: %0 dump {filename} 
    38   ECHO               restore {filename} 
    39   ECHO               backup {directory} {prefix} 
    40   ECHO               initdb 
    41   ECHO               schema 
    42   ECHO               schema-export 
     44  ECHO   Usage: %0 dump {filename} 
     45  ECHO              restore {filename} 
     46  ECHO              backup {directory} {prefix} 
     47  ECHO              initdb 
     48  ECHO              schema 
     49  ECHO              schema-export 
    4350  GOTO end 
    4451 
    4552 
    4653:dump 
    47   ECHO Dumping data: 
    48   ECHO %DUMPCMD% -appname %APPNAME% -f %2 %3 %4 %5 %6 %7 %8 %9 
     54  ECHO   Dumping data: 
     55  ECHO. 
     56  ECHO   %DUMPCMD% -appname %APPNAME% -f %2 %3 %4 %5 %6 %7 %8 %9 
    4957  %DUMPCMD% -appname %APPNAME% -f %2 %3 %4 %5 %6 %7 %8 %9 
    5058  GOTO end 
    5159  :: 
    5260:restore 
    53   ECHO Restoring data: 
    54   ECHO %RESTORECMD% -appname %APPNAME% -f %2 %3 %4 %5 %6 %7 %8 %9 
     61  ECHO   Restoring data: 
     62  ECHO. 
     63  ECHO   %RESTORECMD% -appname %APPNAME% -f %2 %3 %4 %5 %6 %7 %8 %9 
    5564  %RESTORECMD% -appname %APPNAME% -f %2 %3 %4 %5 %6 %7 %8 %9 
    5665  GOTO end 
    5766  :: 
    5867:restore-for-quickstart 
    59   ECHO Restoring data for quickstart: 
    60   ECHO %RESTORECMD% -appname %APPNAME% -onlyusers "public-user,caladmin,douglm,agrp_*" -f %2 %3 %4 %5 %6 %7 %8 %9 
     68  ECHO   Restoring data for quickstart: 
     69  ECHO. 
     70  ECHO   %RESTORECMD% -appname %APPNAME% -onlyusers "public-user,caladmin,douglm,agrp_*" -f %2 %3 %4 %5 %6 %7 %8 %9 
    6171  %RESTORECMD% -appname %APPNAME% -onlyusers "public-user,caladmin,douglm,agrp_*" -f %2 %3 %4 %5 %6 %7 %8 %9 
    6272  GOTO end 
    6373  :: 
    6474:backup 
    65   ECHO Backing up data: 
    66   ECHO $"The backup target is not currently configured." 
    67   :: TARGET=$2/$3`date +%Y%m%d_%H%M%S`.ldif 
    68   :: %DUMPCMD% -appname %APPNAME% -f $TARGET 
    69   :: %DUMPCMD% -appname %APPNAME% -f $TARGET 
     75  :: first strip out delimeters from date and time 
     76  echo %date% > temp.txt 
     77  for /f "tokens=1-4 delims=/ " %%a in (temp.txt) do ( 
     78    set dname=%%a 
     79    set mm=%%b 
     80    set dd=%%c 
     81    set yy=%%d 
     82  ) 
     83  echo %time% > temp.txt 
     84  for /f "tokens=1-3 delims=: " %%a in (temp.txt) do ( 
     85    set hh=%%a 
     86    set mn=%%b 
     87    set ss=%%c 
     88  ) 
     89  echo %hh%%mn%%ss% > temp.txt 
     90  for /f "tokens=1-2 delims=. " %%a in (temp.txt) do ( 
     91    set tm=%%a 
     92    set ms=%%b 
     93  ) 
     94  SET TARGET=%2\%3%yy%%mm%%dd%_%tm%%ms%.xml 
     95 
     96  :: now backup the data 
     97  ECHO   Backing up data into: 
     98  ECHO   %TARGET% 
     99  ECHO. 
     100  ECHO   %DUMPCMD% -appname %APPNAME% -f %TARGET% 
     101  %DUMPCMD% -appname %APPNAME% -f %TARGET% 
    70102  GOTO end 
    71103  :: 
    72104:initdb 
    73   ECHO Initializing the database: 
    74   ECHO %RESTORECMD% -appname %APPNAME% -f ./data/initbedework.xml -initSyspars 
     105  ECHO   Initializing the database: 
     106  ECHO. 
     107  ECHO   %RESTORECMD% -appname %APPNAME% -f ./data/initbedework.xml -initSyspars 
    75108  %RESTORECMD% -appname %APPNAME% -f ./data/initbedework.xml -initSyspars 
    76109  GOTO end 
    77110  :: 
    78111:schema 
    79   ECHO Creating the schema: 
    80   ECHO %SCHEMACMD% --text --create --config=./classes/hibernate.cfg.xml --output=schema.sql 
     112  ECHO   Creating the schema: 
     113  ECHO. 
     114  ECHO   %SCHEMACMD% --text --create --config=./classes/hibernate.cfg.xml --output=schema.sql 
    81115  %SCHEMACMD% --text --create --config=./classes/hibernate.cfg.xml --output=schema.sql 
    82116  GOTO end 
    83117  :: 
    84118:schema-export 
    85   ECHO Exporting the schema: 
    86   ECHO %SCHEMACMD% --create --config=./classes/hibernate.cfg.xml --output=schema.sql 
     119  ECHO   Exporting the schema: 
     120  ECHO. 
     121  ECHO   %SCHEMACMD% --create --config=./classes/hibernate.cfg.xml --output=schema.sql 
    87122  %SCHEMACMD% --create --config=./classes/hibernate.cfg.xml --output=schema.sql 
    88123  GOTO end 
     
    90125 
    91126:end 
     127ECHO. 
     128ECHO. 
  • trunk/calendar3/deployment/dumprestore/shellscr/resources/dumpres.sh

    r568 r613  
    2929    ;; 
    3030  backup) 
    31     TARGET=$2/$3`date +%Y%m%d_%H%M%S`.ldif 
     31    TARGET=$2/$3`date +%Y%m%d_%H%M%S`.xml 
    3232    echo $DUMPCMD -appname $APPNAME -f $TARGET 
    3333    $DUMPCMD -appname $APPNAME -f $TARGET