home *** CD-ROM | disk | FTP | other *** search
/ Network Support Encyclopedia 96-1 / novell-nsepro-1996-1-cd2.iso / download / gw / res.exe / RES.BAT next >
DOS Batch File  |  1995-10-30  |  3KB  |  88 lines

  1. The following page shows the OAMARCHI and OAMRESTO Applications
  2. Command lines and Batch files needed to run Archive and Restore.
  3.  
  4. Here are a couple of things to remember:
  5.  
  6. 1.   Remember to change the Object Access Modules (accessed through
  7.      Setup|Control|Object) so that Archiving and Restoring are
  8.      reading the new OAMs.  This step is only needed if new OAMs
  9.      are created rather then editing the current OAMs.
  10.  
  11. 2.   Restore.bat will need to be located on a network so that
  12.      everyone will have the ability to restore a document.  Also,
  13.      make sure that the OAM Restoration application is changed to
  14.      read the batch file on the network.
  15.  
  16. 3.   In the Archive/Restore batch file examples the archive
  17.      directory is C:\Archive.  Change the batch files to copy
  18.      documents to the proper Archive directory structure.  
  19.  
  20. 4.   Please note that these batch files are intended as examples
  21.      only.  These may be modified to suit your own purposes, such as
  22.      allowing for dynamic mapping/attaching to the archive location 
  23.      (i.e. using the NetWare map, map del, & logout commands).
  24.  
  25. Here are the command line parameters:
  26.    OAMARCHI command line:  c:\archive.bat %p %f %q %r[ ]
  27.    OAMRESTO command line:  c:\restore.bat %p %f %q %r[ ] %j
  28.  
  29. Archive.bat
  30.  
  31.    @echo off
  32.    rem ***Check for the existance of the source file.
  33.    rem ***Return an error if it doesn't exist.
  34.  
  35.    if exist %1%2 goto start
  36.    echo ERRORError: File not found. File not archived > %4
  37.    goto end
  38.  
  39.    rem ***Create the archive set directory if necessary,
  40.    rem ***then archive the file and delete the copy.
  41.    rem ***Return an error if unsuccessful.
  42.    
  43.    :start
  44.    if not exist c:\archive\%3\*.* md c:\archive\%3
  45.    copy %1%2 c:\archive\%3\%2 > nul
  46.    if exist c:\archive\%3\%2 goto finish
  47.    echo ERRORError moving file. File not archived > %4
  48.    goto end
  49.  
  50.    :finish
  51.    del %1%2
  52.  
  53.    :end
  54.  
  55.  
  56. Restore.bat
  57.  
  58.    @echo off
  59.    rem ***Check Job Type to see if On-Line Check or Restore Operation
  60.    rem ***  Job Type 40 = Restore   Job Type 41 = On-Line Check
  61.    if %5==40 goto restore
  62.  
  63.    rem ***On-Line Check Operation
  64.    :online
  65.    
  66.    rem ***Check to see if the file exists in the archive area.
  67.    rem ***If not, return an error.
  68.    
  69.    if exist c:\archive\%3\%2 goto end
  70.    echo ERRORError: The file is not on-line > %4
  71.    goto end
  72.  
  73.    rem ***Restore Operation.
  74.    :restore
  75.  
  76.    rem ***Restore the file and delete the copy in the archive area.
  77.    rem ***Return an error if unable to move the file.
  78.    
  79.    copy c:\archive\%3\%2 %1%2 > nul
  80.    if exist %1%2 goto continue
  81.    echo ERRORError moving file. File not restored > %4
  82.    goto end
  83.  
  84.    :continue
  85.    del c:\archive\%3\%2
  86.  
  87.    :end
  88.