home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / plawok22.zip / PWDISK1.ZIP / ff / cfg / ffrest.cmd < prev    next >
OS/2 REXX Batch file  |  1994-05-21  |  4KB  |  86 lines

  1. @setlocal
  2. @rem - tqpripth and tqsecpth are modified by coins when the
  3. @rem - node is configured
  4. @set tqpripth=C:\FF\DATADEF\FILES
  5. @set tqsecpth=C:\FF\DATADEF\FILES
  6. @if "%1" == "" @echo Insufficient command line arguments.
  7. @if "%1" == "" @goto exit
  8. @if "%2" == "" @echo Insufficient command line arguments.
  9. @if "%2" == "" @goto exit
  10. @if "%3" == "" @echo Insufficient command line arguments.
  11. @if "%3" == "" @goto exit
  12. @if "%4" == "" @echo Insufficient command line arguments.
  13. @if "%4" == "" @goto exit
  14. @if "%5" == "" @echo Insufficient command line arguments.
  15. @if "%5" == "" @goto exit
  16. @mkdir %tqpripth% 2> nul
  17. @mkdir %tqsecpth% 2> nul
  18. @set error=false
  19. @echo Decompressing (if necessary) and transferring files...
  20. @echo    Network configuration files...
  21. @if exist %5\cfg\pwnet.cfg @pcterse /l /r /d %5\cfg\pwnet.cfg %1\cfg
  22. @if exist %5\cfg\net.cfg @pcterse /l /r /d %5\cfg\net.cfg %1\cfg
  23. @if exist %5\cfg\pwio.cfg @pcterse /l /r /d %5\cfg\pwio.cfg %1\cfg
  24. @if exist %5\cfg\network.cfg @pcterse /l /r /d %5\cfg\network.cfg %1\cfg
  25. @if errorlevel 1 @goto err_exit
  26. @echo    Runtime configuration files...
  27. @if exist %5\vision\files\vconfig @pcterse /l /r /d %5\vision\files\vconfig %1\vision\files
  28. @if errorlevel 1 @goto err_exit
  29. @if exist %5\vision\files\algbckup.tbl @pcterse /l /r /d %5\vision\files\algbckup.tbl %1\vision\files
  30. @if errorlevel 1 @goto err_exit
  31. @if exist %1\vision\files\dlt\cur\*.* @echo Y | erase %1\vision\files\dlt\cur\*.* 1> nul 2> nul
  32. @set error=false
  33. @if exist %5\vision\files\dlt\cur\*.* @pcterse /l /r /d %5\vision\files\dlt\cur\*.* %1\vision\files\dlt\cur
  34. @if errorlevel 1 @goto err_exit
  35. @echo    PlantWorks Database Update Process files...
  36. @pcterse /l /r /d %5\vision\data\*.* %1\vision\files\data
  37. @if errorlevel 1 @goto err_exit
  38. @if exist %5\im\primary\*.??0 @echo    Report Generation tables...
  39. @if exist %5\im\primary\*.??0 @pcterse /l /r /d %5\im\primary\*.??0 %2
  40. @if errorlevel 1 @goto err_exit
  41. @if exist %5\im\files\im*.* @goto do_imfiles
  42. @goto join
  43. :do_imfiles
  44. @echo    Item files...
  45. @if exist %4\0*. @erase %4\0*.
  46. @pcterse /l /r /d %5\im\files\imsv*.* %4
  47. @if exist %5\im\files\imfiles.arc @goto newpct
  48. @pcterse /l /r /d %5\im\files\*. %4
  49. @if errorlevel 1 @goto err_exit
  50. @goto join
  51. :newpct
  52. @pcterse /l /r /d /a %5\im\files\imfiles.arc %4
  53. @if errorlevel 1 @goto err_exit
  54. :join
  55. @echo    User created C functions...
  56. @if exist %5\usrdll\*.dll @pcterse /l /r /d %5\usrdll\*.dll %1\usrdll
  57. @if errorlevel 1 @goto err_exit
  58. @echo    User created bitmaps...
  59. @if exist %5\bitmaps\*.* @pcterse /l /r /d %5\bitmaps\*.* %1\bitmaps
  60. @if errorlevel 1 @goto err_exit
  61. @echo    CS2 tables/queues created through PlantWorks Data Definition...
  62. @if exist %5\datadef\USERDEF.?DF @pcterse /l /r /d %5\datadef\USERDEF.?DF %1\DATADEF\FILES
  63. @if errorlevel 1 @goto err_exit
  64. @if exist %5\datadef\USERDEF.?DF @tqmaint -D%1\DATADEF\FILES -I
  65. @if errorlevel 2 @goto C_S_2_E_R_R_O_R
  66. @if errorlevel 1 @goto err_exit
  67. @rem erase old tables/queues from the \ff\datadef\files directory - PN56915
  68. @if exist %tqpripth%\*.*0 @erase %tqpripth%\*.*0
  69. @if exist %tqsecpth%\*.*1 @erase %tqsecpth%\*.*1
  70. @if exist %5\datadef\primary\*.??0 @pcterse /l /r /d %5\datadef\primary\*.* %tqpripth%
  71. @if exist %5\datadef\shadow\*.??1 @pcterse /l /r /d %5\datadef\shadow\*.* %tqsecpth%
  72. @if errorlevel 1 @goto err_exit
  73. @echo ---------------------------------------
  74. @echo Database restore completed successfully
  75. @echo ---------------------------------------
  76. @goto exit
  77. :C_S_2_E_R_R_O_R
  78. @echo Unable to communicate with Communications System/2.
  79. @echo Can NOT restore tables/queues.
  80. :err_exit
  81. @echo The previous error prevented the restore operation from continuing.
  82. @echo Correct the error condition and retry the operation.
  83. :exit
  84. @pause
  85. @endlocal
  86.