home *** CD-ROM | disk | FTP | other *** search
/ Beijing Paradise BBS Backup / PARADISE.ISO / bbs / RA / RUNRA.BAT < prev    next >
Encoding:
DOS Batch File  |  1976-11-24  |  2.9 KB  |  68 lines

  1.           @echo off
  2.           REM                  Set environment variables.
  3.           SET RA=d:\bbs\RA
  4.           
  5.           :Start
  6.              REM               Start the main batch file loop.
  7.              Cls
  8.              Echo Starting RemoteAccess Node %1
  9.              CD \bbs\RA\NODE%1
  10.              \bbs\RA\RA -E10 -N%1
  11.              REM               After RA exits, trap the errorlevel.
  12.           
  13.           :AfterRA
  14.              IF ERRORLEVEL 20 GOTO Maintain
  15.              IF ERRORLEVEL 10 GOTO Start
  16.              IF ERRORLEVEL 2  GOTO Local
  17.              IF ERRORLEVEL 0  GOTO Quit
  18.           
  19.           :Maintain
  20.              REM               Since this is a multi-node system, we
  21.              REM               should leave maintenance tasks to one
  22.              REM               node only to avoid having two nodes
  23.              REM               performing the same tasks at the same
  24.              REM               time.  If node 2 is running the event,
  25.              REM               it will stop and wait until node 1 is
  26.              REM               finished.  It then continues batch file
  27.              REM               execution.
  28.              CD \bbs\RA
  29.              REM               If not node 1 go wait while node 1 does
  30.              REM               maintenance tasks.
  31.              IF NOT %1 == 1 GOTO Wait
  32.              REM               Create a semaphore file called
  33.              REM               RAWAIT.SEM
  34.              ECHO ... >RAWAIT.SEM
  35.              REM               Pack the user database deleting users
  36.              REM               who have not called in 60 days.  Also
  37.              REM               sort the user file.
  38.              RAUSER -S -P -D60
  39.              REM               Pack the message database purging
  40.              REM               messages according to the threshold 
  41.              REM               information contained in MESSAGES.RA.
  42.              REM               Renumber the database updating reply
  43.              REM               chains and user LastRead pointers.
  44.              RAMSG PACK -Purge -Renumber
  45.              REM               This concludes maintenance tasks.
  46.              REM               Delete the semaphore file and then
  47.              REM               recycle the batch file.
  48.              ERASE RAWAIT.SEM
  49.              GOTO Start
  50.           
  51.           :Local
  52.              REM               Local logon mode
  53.              CD \bbs\RA\NODE%1
  54.              \bbs\RA\RA -E10 -L -N%1
  55.              REM               When finished, goto AfterRA to trap
  56.              REM               the errorlevel returned.
  57.              GOTO AfterRA
  58.  
  59.           :Wait
  60.              REM               Wait here until the file RAWAIT.SEM
  61.              REM               no longer exists
  62.              IF EXIST RAWAIT.SEM GOTO Wait
  63.              REM               If it doesn't exist, recycle.
  64.              Goto Start
  65.           
  66.           :Quit
  67.              REM               Exit the batch file.
  68.