log_full.bat 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. @echo off
  2. REM ###########################################################################
  3. REM #
  4. REM # INFORMIX SOFTWARE, INC.
  5. REM #
  6. REM # PROPRIETARY DATA
  7. REM #
  8. REM # THIS DOCUMENT CONTAINS TRADE SECRET DATA WHICH IS THE PROPERTY OF
  9. REM # INFORMIX SOFTWARE, INC. THIS DOCUMENT IS SUBMITTED TO RECIPIENT IN
  10. REM # CONFIDENCE. INFORMATION CONTAINED HEREIN MAY NOT BE USED, COPIED OR
  11. REM # DISCLOSED IN WHOLE OR IN PART EXCEPT AS PERMITTED BY WRITTEN AGREEMENT
  12. REM # SIGNED BY AN OFFICER OF INFORMIX SOFTWARE, INC.
  13. REM #
  14. REM # THIS MATERIAL IS ALSO COPYRIGHTED AS AN UNPUBLISHED WORK UNDER
  15. REM # SECTIONS 104 AND 408 OF TITLE 17 OF THE UNITED STATES CODE.
  16. REM # UNAUTHORIZED USE, COPYING OR OTHER REPRODUCTION IS PROHIBITED BY LAW.
  17. REM #
  18. REM # Description Automates logical log backup using event alarms from the
  19. REM # database server. To install this script, add the following
  20. REM # line to the ONCONFIG file -
  21. REM # ALARMPROGRAM <informixdir>/etc/log_full.bat
  22. REM # where <informixdir> is replaced by the full value of
  23. REM # %INFORMIXDIR%
  24. REM #
  25. REM##########################################################################
  26. REM ###
  27. REM # setup the WINROOT path
  28. REM ###
  29. set WINROOT=%SystemRoot%
  30. if "x%WINROOT%" == "x" set WINROOT=C:\WINNT
  31. set BACKUP_CMD=onbar -b -l
  32. set EXIT_STATUS=0
  33. set EVENT_SEVERITY=%1%
  34. set EVENT_CLASS=%2%
  35. set EVENT_MSG="%3%"
  36. set EVENT_ADD_TEXT="%4%"
  37. set EVENT_FILE="%5%"
  38. if %EVENT_CLASS% == 23 goto CONT_LOG
  39. REM # One program is shared by all event alarms. If this ever gets expanded to
  40. REM # handle more than just archive events, uncomment the following:EXIT_STATUS=1
  41. REM # set EXIT_STATUS=1
  42. goto DONE
  43. :CONT_LOG
  44. REM # onbar assumes no operator is present,
  45. REM # so all messages are written to the activity
  46. REM # log and there shouldn't be any output, but
  47. REM # send everything to nul just in case
  48. %BACKUP_CMD% 2>&1 >> NUL
  49. REM # 0 means BACKUP_CMD was successful
  50. if ERRORLEVEL 1 goto ERROR
  51. if ERRORLEVEL 0 goto SUCCESS
  52. goto DONE
  53. :ERROR
  54. set EXIT_STATUS=1
  55. goto DONE
  56. :SUCCESS
  57. set EXIT_STATUS=0
  58. :DONE
  59. exit %EXIT_STATUS%