onbar.bat 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. @echo off
  2. REM ###########################################################################
  3. REM #
  4. REM # Licensed Material - Property Of IBM
  5. REM #
  6. REM # "Restricted Materials of IBM"
  7. REM #
  8. REM # IBM Informix Dynamic Server
  9. REM #
  10. REM # (c) Copyright IBM Corporation 1996, 2012 All rights reserved.
  11. REM #
  12. REM # Title: onbar
  13. REM # Description: Wrapper script for Informix Backup and Restore (ON-Bar).
  14. REM # Users may edit this script to customize backup and
  15. REM # restore operations, including specific Storage Manager
  16. REM # setup and cleanup procedures.
  17. REM #
  18. REM ###########################################################################
  19. set SAVEPATH=%PATH%
  20. if x%ISMDIR% NEQ x goto cont
  21. if exist %INFORMIXDIR%\bin\setism.bat call %INFORMIXDIR%\bin\setism.bat
  22. :cont
  23. if DEFINED ISMDIR set PATH=%ISMDIR%\bin;%PATH%
  24. if DEFINED INFORMIXDIR goto goodenv
  25. echo You need to set the variable INFORMIXDIR in your Windows environment
  26. goto end
  27. :goodenv
  28. REM #############################
  29. REM # add startup processing here
  30. REM #############################
  31. REM ########################
  32. REM # end startup processing
  33. REM ########################
  34. REM # Run the onbar driver
  35. %INFORMIXDIR%\bin\onbar_d %*
  36. set onbar_d_return=%errorlevel%
  37. REM #############################
  38. REM # add cleanup processing here
  39. REM #############################
  40. REM # Default cleanup processing for the ISM:
  41. REM # If we've just done a backup with the ISM, back up the ISM catalogs.
  42. REM # It's safe to check %1 because onbar commands must start with -[blr].
  43. REM # We ignore ism_catalog errors because we're not sure that the ISM
  44. REM # is being used at this site or on a particular coserver.
  45. if "%1" == "-b" goto ism
  46. if "%1" == "-l" goto ism
  47. goto skip
  48. :ism
  49. if NOT "%onbar_d_return%" == "0" goto skip
  50. if NOT DEFINED ISMDIR goto skip
  51. if NOT exist %ISMDIR%\bin\ism_catalog.exe goto skip
  52. %ISMDIR%\bin\ism_catalog -create_bootstrap -pool ISMData >NUL 2>NUL
  53. :skip
  54. REM ########################
  55. REM # end cleanup processing
  56. REM ########################
  57. REM # return the error from onbar_d
  58. %INFORMIXDIR%\bin\set_error %onbar_d_return%
  59. :end
  60. set PATH=%SAVEPATH%
  61. %INFORMIXDIR%\bin\set_error %onbar_d_return%