home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / netbck01.zip / NETBACK.CMD < prev    next >
OS/2 REXX Batch file  |  1994-05-19  |  29KB  |  467 lines

  1. /* */
  2.  
  3. PARSE ARG ArgGroup
  4.  
  5. /* ***************************************************************************** *
  6.  *      Schedule. stem record as follows:                                        *
  7.  *      Schedule.UserCount              <- # Users in BACKUP.DAT schedule list   *
  8.  *              .{UserIndex}.DiskCount  <- Number of disks user has              *
  9.  *                          .Disk{1}    <- First Disk name                       *
  10.  *                            :                                                  *
  11.  *                          .Disk{DiskCount} <- last disk name                   *
  12.  *                          .ReqId      <- Requester Id                          *
  13.  *                          .Status     <- Marked as PENDING | NOT ONLINE        *
  14.  *                          .UserId     <- User ID for this ReqId                *
  15.  *                          .NickName   <- Users nickname for msgs               *
  16.  * ------------------------------------------------------------------------------*
  17.  * HISTORY:                                                                      *
  18.  *                                                                               *
  19.  *  1/Oct/93 : Fixed problem where a defined user had peer running but did not   *
  20.  *             have any peer disks defined.  I was 'PULL'ing from an empty queue *
  21.  *             in this case and so system would 'hang' waiting for input from    *
  22.  *             the keyboard.                                                     *
  23.  *                                                                               *
  24.  *             Effected routine: FindRemoteDisks()                               *
  25.  *             Change:           Added check for first line in queue containing  *
  26.  *                               the word 'THERE' (Hard coded response from NET  *
  27.  *                               cmd indicating 'THERE ARE NO ENTRIES IN THE LIST*
  28.  *                               If LS NET.EXE changes is return command this    *
  29.  *                               probably break again. Unfor. NET.EXE does not   *
  30.  *                               use RC to indicate if the net command found real*
  31.  *                               data, just that the NET.EXE cmd did execute.    *
  32.  *                                                                               *
  33.  *                                                                               *
  34.  *             Added the 'EchoCh' variable. If it is set to '@' then system cmds *
  35.  *             are NOT echoed to console. If it is set to ''(null) then cmds     *
  36.  *             ARE ECHOED to console.  For debugging purposes..                  *
  37.  *                                                                               *
  38.  * 15/Nov/93:  Due to another change in the NET output of error data I've        *
  39.  *             changed the FindRemoteDisks() function once again.                *
  40.  *             NET no longer directs error data to STDIO when a \\server is      *
  41.  *             not found.  Now it just goes to STDERR which is not trapped       *
  42.  *             by RXQUEUE.  So I now test for an empty queue and treat that      *
  43.  *             as an error condition as well.                                    *
  44.  *                                                                               *
  45.  * 07/Mar/94: Added two lines to start of exec to FORCE a change to the correct  *
  46.  *            DRIVE and DIRECTORY where Sytos lives.  Apparently Clock starts    *
  47.  *            all apps from C: and when we moved Sytos to D: the exec would fail.*
  48.  * ***************************************************************************** */
  49.  
  50. signal on halt name ProgErr
  51. signal on syntax name ProgErr
  52.  
  53.  /* *************************************************************************** *
  54.   * Change the following settings based on your Lan server setup                *
  55.   * *************************************************************************** */
  56.  
  57. 'C:'                                                      /* Select home drive where SYPLUS is found */
  58. 'CD \SYPLUS'                                              /* Switch to the SYPLUS directory          */
  59. AdminID = 'ADMIN'                                         /* Admin ID used for PEER backups          */
  60. AdminPW = 'SMITH'                                         /* Admin ID Password used to logon to ID   */
  61. RemoteDiskId = 'M:'                                       /* DiskID defined in APPEND/NEWTAPE.MAC    */
  62. EchoCh      = ''                                          /* -DEBUG- '@':no con echo, '':= con echo  */
  63.  
  64.  /* *************************************************************************** *
  65.   *                   End of site customized variables                          *
  66.   * *************************************************************************** */
  67.  
  68. LogRc = Log("Starting NETBACK.CMD")                       /* Log start of execution                  */
  69. BackupGroup = 0                                           /* Group of users to  backup               */
  70. Online.   = ''                                            /* User's currently on line                */
  71. Schedule. = ''                                            /* User's scheduled for backup             */
  72. CurBackupId = 0                                           /* Current user ID being processed         */
  73. CurBackupDiskId = 1                                       /* Current users disk ID being processed   */
  74. MsgPending = ', Your system is scheduled for backup at',  /* MSG: Warn user of pending backup        */
  75.              ' this time. DO NOT LOGOFF till you are',
  76.              ' told it is safe to do so.  Thanks.. '
  77. MsgStarting= ', Your system is being backed up RIGHT',    /* MSG: Warn user of ACTIVE backup         */
  78.              ' NOW! Do NOT LOGOFF till you are',
  79.              ' told it is safe to do so.  Thanks.. '
  80. MsgAllDoneOk=', Your system has been successfully',       /* MSG: OK Completed backup                */
  81.              ' backed up. You may now LOGOFF safely.'
  82. CurMsg = ''
  83.  
  84. IF ArgGroup <> '' THEN                                    /* If group is NOT blank, set to specific  */
  85.   BackupGroup = ArgGroup                                  /*   group, else do everyone.              */
  86.  
  87. CurDate = DATE()                                          /* Tag current date                        */
  88. CurTime = TIME()                                          /* Tag current time                        */
  89. CurMacroName = 'CURRENT NET  BACKUPS'                     /* Change MACRO  NAME                      */
  90.  
  91. EchoCh||'LOGOFF /D'                                       /* Do a logoff JIC                         */
  92. EchoCh||'LOGON 'AdminID' /P:'AdminPW' /V:D'               /* Do a LOGON to the backup id (ADMIN)     */
  93. IF (RC <> 0) THEN                                         /* FAILED?                                 */
  94.    DO
  95.      SAY "UNABLE TO LOGON TO REQUIRED MASTER ID. TERMINATING"  /* YES: ABORT                         */
  96.      LogRc = Log("UNABLE TO LOGON TO REQUIRED MASTER ID. TERMINATING" )
  97.      EXIT
  98.    END
  99.  
  100. MyRc = LoadBackupList()                                   /* Read the list of backup REQUESTERS      */
  101. MyRc = PullLoggedOnUsers()                                /* Get net info on who's logged on NOW     */
  102. MyRc = MarkMissingUsers()                                 /* Verify list against logged on users     */
  103. MyRc = FindRemoteDisks()                                  /* Locate remote disks and record for bkup */
  104. MyRc = DebugDumpSchedule()
  105. MyRc = SetupNewTapeMacro()                                /* Create NEW TAPE macro for SYTOS         */
  106.  
  107.          /* *************************************************** *
  108.           * FIRST backup is special as we must use a macro that *
  109.           * will ERASE the tape first, then setup a VOL NAME    *
  110.           * *************************************************** */
  111.                          
  112. CurBackupId = FindFirst()                                 /* Find first PENDING backup in list       */
  113. IF( CurBackupId = 0) THEN                                 /* Handle NO PENDINGs found                */
  114.    DO
  115.      SAY "NO USERS FOUND PENDING TO DO BACKUPS"
  116.      LogRc = Log("NO USERS FOUND PENDING TO DO BACKUPS" )
  117.      EXIT
  118.    END
  119.      
  120. MyRc = DebugDumpSchedule()
  121.  
  122. MyRc = PostNetMsg(CurBackupId, MsgStarting )                /* Build STARTING msg                   */
  123. MyRc = SetTapeSetName( Schedule.CurBackupId.ReqId,Schedule.CurBackupId.Disk1 )
  124. LogRc = Log("Backing up user "|| Schedule.CurBackupId.UserId||" Disk: "||Schedule.CurBackupId.Disk1)
  125. EchoCh||'NET USE 'RemoteDiskId' \\'Schedule.CurBackupId.ReqId'\'Schedule.CurBackupId.Disk1 ' > NUL'
  126. 'SYPLUS "'CurMacroName'"'                                   /* Do the FIRST backup for this user.   */
  127. 'NET USE 'RemoteDiskId' /D  > NUL'                                     /* RELEASE from users disk              */
  128. LogRc = Log("END BACKUP user "|| Schedule.CurBackupId.UserId||" Disk: "||Schedule.CurBackupId.Disk1)
  129.  
  130.          /* *************************************************** *
  131.           * NEXT backup onward are normal in that we just walk  *
  132.           * the list of drives to be backed up and keep append  *
  133.           * to the tape volume using an APPEND macro.           *
  134.           * *************************************************** */
  135.  
  136. MyRc = DebugDumpSchedule()
  137.  
  138. MyRc = SetupAppTapeMacro()                                /* Create APPEND tape macro for SYPLUS     */
  139. NextDisk = FindNext()                                     /* Locate next available disk to backup    */
  140.  
  141. DO WHILE (NextDisk <> 'DONE')
  142.    MyRc = SetTapeSetName( Schedule.CurBackupId.ReqId,Schedule.CurBackupId.NextDisk )
  143.    LogRc = Log("Backing up user "|| Schedule.CurBackupId.UserId||" Disk: "||Schedule.CurBackupId.NextDisk)
  144.    EchoCh||'NET USE 'RemoteDiskId' \\'Schedule.CurBackupId.ReqId'\'Schedule.CurBackupId.NextDisk '  > NUL'
  145.    'SYPLUS "'CurMacroName'"'                              /* Do the FIRST backup for this user.      */
  146.    EchoCh||'NET USE 'RemoteDiskId' /D  > NUL'                                /* RELEASE from users disk                 */
  147.    LogRc = Log("END BACKUP user "|| Schedule.CurBackupId.UserId||" Disk: "||Schedule.CurBackupId.NextDisk)
  148.    NextDisk = FindNext()                                  /* Locate next available disk to backup    */
  149.   END
  150.  
  151. MyRc = DebugDumpSchedule()                                /* just a debug dump                       */
  152. LogRc = Log("ENDED NETBACK.CMD")                       /* Log start of execution                  */
  153.  
  154. ProgErr:
  155. EchoCh||'LOGOFF /D'                                       /* Do a logoff JIC                         */
  156.  
  157. EXIT
  158.  
  159. /* ============================================================================= */
  160. /* LoadBackupList:     Reads the BACKUP.DAT file to determine which stations     */
  161. /*                     should be backed up in this pass                          */
  162. /* ============================================================================= */
  163. LoadBackupList:                  PROCEDURE EXPOSE Schedule. BackupGroup EchoCh
  164.  DatFile = 'NETBACK.DAT'
  165.  
  166.  SIGNAL ON NOTREADY                                         /* Do this when EOF                     */
  167.  count = 0
  168.  DO FOREVER
  169.    line = LINEIN( DatFile )                                 /* Get line from file                   */
  170.    IF (STRIP( line) \= '') THEN                             /* Valid line ?                         */
  171.       DO                                                    /* YES:                                 */
  172.         IF (BackupGroup = 0) THEN                           /* Is group set to EVERYONE?            */
  173.           DO                                                /* YES:                                 */
  174.             count = count + 1                               /*    Pull/parse user backup record     */
  175.             Schedule.Count.UserId   = WORD(Line,2)          /*              UserId                  */
  176.             Schedule.Count.ReqId    = WORD(Line,3)          /*              ReqId                   */
  177.             Schedule.Count.NickName = WORD(Line,4)          /*              NickName                */
  178.             Schedule.Count.Status   = 'NOT ONLINE'          /*    Default status of NOT ONLINE      */
  179.             Schedule.Count.DiskCount= 0                     /*    Default to NO DISKS AVAILABLE (0) */
  180.           END
  181.         ELSE                                                /* NO:                                  */
  182.           DO
  183.              TmpGroup = WORD(Line,1)                        /*  Get this record's group identifier  */
  184.              IF (TmpGroup = BackupGroup) THEN               /*  Is it EQ to specified group?        */
  185.                DO                                           /*  YES:                                */
  186.                  count = count + 1                          /*    Normal Pull/Parse user backup rec */
  187.                  Schedule.Count.UserId   = WORD(Line,2)
  188.                  Schedule.Count.ReqId    = WORD(Line,3)
  189.                  Schedule.Count.NickName = WORD(Line,4)
  190.                  Schedule.Count.Status   = 'NOT ONLINE'
  191.                  Schedule.Count.DiskCount= 0                /*    Default to NO DISKS AVAILABLE (0) */
  192.                END
  193.           END  /* else */
  194.       END /* if strip() */
  195.  END /* forever */
  196.  
  197. NOTREADY:                                                   /* EOF reached                          */
  198. Schedule.UserCount = Count                                  /* Save user records count              */
  199.  
  200. RETURN 0
  201.  
  202. /* ============================================================================= */
  203. /* FindNext:           This locates the next available disk/user id, returns     */
  204. /*                     his schedule ID# and flags him as 'PROCESSING'            */
  205. /* ============================================================================= */
  206. FindNext:    PROCEDURE EXPOSE Schedule. CurBackupId CurBackupDiskId MsgAllDoneOk MsgStarting EchoCh
  207.  
  208.           /* ======================================= *
  209.            * Handle possible multi drives per user   *
  210.            * ======================================= */
  211.  
  212.   IF CurBackupDiskId <> Schedule.CurBackupId.DiskCount THEN   /* More DISKS for this user ?         */
  213.     DO                                                        /* YES:                               */
  214.      CurBackupDiskId = CurBackupDiskId + 1                    /*      set next disk id #            */
  215.      RETURN 'DISK'||CurBackupDiskId                           /*      return DISK#                  */
  216.     END
  217.           /* ======================================= *
  218.            * Handle NEXT 'PENDING' user id backup    *
  219.            * ======================================= */
  220.  
  221.   MyRc = PostNetMsg(CurBackupId, MsgAllDoneOk)                /* Send OLD user BACKUP ENDED msg     */
  222.  
  223.   CurBackupId = FindFirst()                                   /* Locate NEXT pending user is        */
  224.   IF (CurBackupId = 0) THEN                                   /*   Was there another user PENDING?  */
  225.      DO                                                       /*   NO:                              */
  226.       CurBackupDiskId = 0                                     /*       set disk # to 0              */
  227.       LogRc = Log("No more users to backup")
  228.       RETURN 'DONE'                                           /*       return flag DONE             */
  229.      END
  230.  
  231.   MyRc = PostNetMsg(CurBackupId, MsgStarting)                 /* Send NEW USER BACKUP STARTING msg  */
  232.   CurBackupDiskId = 1                                         /* Mark default FIRST disk            */
  233.   RETURN 'DISK'||CurBackupDiskId                              /* return DISK#                       */
  234.  
  235. /* ============================================================================= */
  236. /* FindFirst:          This locates the first available backup user, returns     */
  237. /*                     his schedule ID# and flags him as 'PROCESSING'            */
  238. /* ============================================================================= */
  239. FindFirst:                  PROCEDURE EXPOSE Schedule. EchoCh
  240.  
  241.  DO x=1 TO Schedule.UserCount                               /* Scanning the Schedule list           */
  242.    IF (Schedule.x.Status == 'PENDING') THEN                 /* IS this user's status PENDING        */
  243.      DO                                                     /*   YES:                               */
  244.       Schedule.x.Status = 'PROCESSING'                      /*       Mark status now PROCESSING     */
  245.       RETURN x                                              /*       return user's index #          */
  246.      END
  247.  END
  248.  
  249.  RETURN 0                                                   /* DEFAULT: 0 = NO PENDINGS FOUND       */
  250.  
  251. /* ============================================================================= */
  252. /* SetTapeVolName:     This alters a machro template by changing the VOL NAME    */
  253. /*                     so we can identify the ReqId this backup belongs to.      */
  254. /* ============================================================================= */
  255. SetTapeVolName:                    PROCEDURE EXPOSE CurDate CurTime CurMacroName EchoCh
  256.  x = SETLOCAL()                                             /* save current directory info          */
  257.  
  258. /* EchoCh||'CD \SYPLUS\SYFILES\SYMAC'                          Switch to SYTOS macro dir            */
  259.    EchoCh||'CD SYFILES\SYMAC'                               /* Switch to SYTOS macro dir            */
  260.  x = CHAROUT( 'CURNET.MAC',CurMacroName,1 )                 /* Change MACRO  NAME                   */
  261.  x = CHAROUT( 'CURNET.MAC',CurDate,77)                      /* Change VOLUME NAME                   */
  262.  x = CHAROUT( 'CURNET.MAC',CurDate||" "||CurTime,97)        /* Change VOLUME DESC                   */
  263.  x = CHAROUT( 'CURNET.MAC' )                                /* Close file                           */
  264.  x = ENDLOCAL()                                             /* Restore previous dir location        */
  265.  
  266. RETURN 0
  267. /* ============================================================================= */
  268. /* SetTapeSetName:     This alters a machro template by changing the SET NAME    */
  269. /*                     so we can identify the ReqId this backup belongs to.      */
  270. /* ============================================================================= */
  271. SetTapeSetName:                    PROCEDURE EXPOSE EchoCh
  272.   PARSE ARG ReqId, DiskName
  273.  
  274.  x = SETLOCAL()                                             /* save current directory info          */
  275.  /* EchoCh||'CD \SYPLUS\SYFILES\SYMAC'                         Switch to SYTOS macro dir            */
  276.  
  277.  EchoCh||'CD SYFILES\SYMAC'                                 /* Switch to SYTOS macro dir            */
  278.  Buff = '                  '                                /* Buff set to 18 SPACES !NO MORE!      */
  279.  x = CHAROUT( 'CURNET.MAC', OVERLAY(DiskName,Buff),151)     /* Change SET NAME                      */
  280.  x = CHAROUT( 'CURNET.MAC', OVERLAY(ReqId,Buff),171)        /* Change SET DESC                      */
  281.  x = CHAROUT( 'CURNET.MAC' )                                /* Close file                           */
  282.  x = ENDLOCAL()                                             /* Restore previous dir location        */
  283.  
  284. RETURN 0
  285.  
  286. /* ============================================================================= */
  287. /* SetupNewTapeMacro:  This sets up a NEW TAPE macro to use as the FIRST         */
  288. /*                     MACRO in a tape set. It erases, create new VOLUME.        */
  289. /*                     It then sets up the first backup SET NAME.                */
  290. /* ============================================================================= */
  291. SetupNewTapeMacro:                 PROCEDURE EXPOSE CurDate CurTime CurMacroName EchoCh
  292.  
  293.   x = SETLOCAL()                                            /* save current directory info          */
  294.  /*  EchoCh||'CD \SYPLUS\SYFILES\SYMAC'                      Switch to SYTOS macro dir              */
  295.  
  296.   EchoCh||'CD SYFILES\SYMAC'                                /* Switch to SYTOS macro dir            */
  297.   EchoCh||'COPY NEWTAPE.MAC CURNET.MAC > NUL'               /*create working copy of macro          */
  298.   MyRc = SetTapeVolName()                                   /* Set vol name to todays date          */
  299.   x = ENDLOCAL()                                            /* Restore previous dir location        */
  300.  
  301. RETURN 0
  302.  
  303. /* ============================================================================= */
  304. /* SetupAppTapeMacro:  This sets up an APPEND  macro to use as the NEXT          */
  305. /*                     MACRO in a tape set. It uses the same VOL name defined    */
  306. /*                     in NEW so that ALL backups now are in same VOLUME.        */
  307. /* ============================================================================= */
  308. SetupAppTapeMacro:                 PROCEDURE EXPOSE CurDate CurTime CurMacroName EchoCh
  309.   
  310.   x = SETLOCAL()                                            /* save current directory info          */
  311. /*  EchoCh||'CD \SYPLUS\SYFILES\SYMAC'                       Switch to SYTOS macro dir              */
  312.  
  313.   EchoCh||'CD SYFILES\SYMAC'                                /* Switch to SYTOS macro dir            */
  314.   EchoCh||'COPY APPEND.MAC CURNET.MAC > NUL'                /* create working copy of macro         */
  315.   MyRc = SetTapeVolName()                                   /* Set vol name to todays date          */
  316.   x = ENDLOCAL()                                            /* Restore previous dir location        */ 
  317.  
  318. RETURN 0
  319.  
  320. /* ============================================================================= */
  321. /* MarkMissingUsers:   Compares logged on users with those sceduled for backup   */
  322. /*                     Missing users are flagged as such, others flagged as      */
  323. /*                     ready for backup (PENDING)                                */
  324. /* ============================================================================= */
  325. MarkMissingUsers:                PROCEDURE EXPOSE OnLine. Schedule. MsgPending EchoCh
  326.  
  327.    DO x=1 TO Schedule.UserCount                             /* Compare Schedule list                */
  328.       DO y=1 TO OnLine.UserCount                            /*  against Online list                 */
  329.          IF (Schedule.x.ReqId == OnLine.y.ReqId) THEN       /*    And if MATCHING ReqId are found   */
  330.            DO 
  331.              Schedule.x.Status = 'PENDING'                  /*    Mark user in Schedule as PENDING  */
  332.              MyRc = PostNetMsg( x, MsgPending )             /* Warn user of backup process          */
  333.            END
  334.       END
  335.    END
  336. RETURN 0
  337. /* ============================================================================= *
  338.  * FindRemoteDisks:    Uses the NET VIEW command to find out what disks each     *
  339.  *                     user has available for backup.  Each disk is added to the *
  340.  *      Schedule. stem record as follows:                                        *
  341.  *      Schedule.{UserIndex}.DiskCount  <- Number of disks user has              *
  342.  *                          .Disk{1}    <- First Disk name                       *
  343.  *                            :                                                  *
  344.  *                          .Disk{DiskCount} <- last disk name                   *
  345.  *                          .ReqId      <- Requester Id                          *
  346.  *                          .Status     <- Marked as PENDING | NOT ONLINE        *
  347.  * ============================================================================= */
  348. FindRemoteDisks:                 PROCEDURE EXPOSE Schedule. EchoCh
  349.  
  350.   DiskIdBase = 'DISK'                                       /* Define the variable base name        */
  351.   DiskId = ''                                               /* Define a working variable            */
  352.   EchoCh||'RXQUEUE /clear'                                         /* Clear the REXX QUEUE                 */
  353.   DO x=1 to Schedule.UserCount                              /* Scan list of users                   */
  354.      IF (Schedule.x.Status = 'PENDING') THEN                /* This user PENDING?                   */
  355.        DO                                                   /*  YES:                                */
  356.          EchoCh||'RXQUEUE /clear'                                   /*     Clear the REXX queue             */
  357.          EchoCh||'NET VIEW \\'Schedule.X.ReqId' | RXQUEUE'          /*     Net request                      */
  358.          Schedule.x.DiskCount = 0                           /*     Set disks to default of 0        */
  359.  
  360.  
  361.          IF ( QUEUED() \= 0 ) THEN
  362.             DO
  363.                PULL line
  364.  
  365.                IF WORD(line,1) == 'THERE' THEN
  366.                   Schedule.x.Status = 'NO DISKS FOUND'
  367.                ELSE
  368.                   DO
  369.                     PULL .
  370.                     PULL .
  371.                     PULL .
  372.                     DO QUEUED()
  373.                        PULL line
  374.                        IF WORD(line,2) == 'DISK' THEN 
  375.                          DO
  376.                           Schedule.x.DiskCount = Schedule.x.DiskCount + 1
  377.                           DiskId = DiskIdBase||Schedule.x.DiskCount
  378.                           Schedule.x.DiskId = WORD(line,1)
  379.                          END
  380.                     END
  381.                   END
  382.  
  383.             END
  384.          ELSE
  385.            Schedule.x.Status = 'NO DISKS FOUND'
  386.        END
  387.   END
  388.  
  389.  
  390. RETURN 0
  391. /* ============================================================================= */
  392. /* PullLoggedOnUsers:  Uses the NET WHO command to find out who is logged on     */
  393. /*                     and adds each user to the stem 'OnLine'                   */
  394. /* ============================================================================= */
  395. PullLoggedOnUsers:               PROCEDURE EXPOSE OnLine.  Schedule. EchoCh
  396.  
  397.   EchoCh||'RXQUEUE /clear'
  398.   EchoCh||'NET WHO | RXQUEUE'
  399.      PULL .
  400.      PULL .
  401.      PULL .
  402.      PULL .
  403.  
  404.   count = 0
  405.   DO QUEUED()
  406.      PULL line
  407.      IF QUEUED() = 0 THEN 
  408.         DO
  409.           OnLine.UserCount = count
  410.           RETURN 0
  411.         END
  412.  
  413.      count = count+1
  414.      OnLine.Count.UserId = WORD(Line,1)
  415.      OnLine.Count.ReqId  = WORD(Line,2)
  416.   END
  417.  RETURN 0
  418. /* ============================================================================= */
  419. /* DebugDumpSchedule:  This just dumps the formatted contents of the internal    */
  420. /*                     stem record containing the user list/status etc.          */
  421. /* ============================================================================= */
  422. DebugDumpSchedule:                PROCEDURE   EXPOSE Schedule. BackupGroup EchoCh
  423.  
  424.   SAY '[GROUP SET  : 'BackupGroup ']'
  425.   SAY '[USER COUNT : 'Schedule.UserCount' ]'
  426.   SAY '===================================='
  427.   DO x=1 TO Schedule.UserCount
  428.     SAY '[REQ:'Schedule.x.ReqId '] [USER: 'Schedule.x.UserId '][STATUS: 'Schedule.x.Status' ]'
  429.     SAY '[DISKS FOUND:'Schedule.x.DiskCount '] '
  430.     DO y=1 TO Schedule.x.DiskCount
  431.        disk = 'DISK'||y
  432.        SAY Schedule.x.disk
  433.     END
  434.    SAY '===================================='
  435.  END
  436.  
  437. RETURN 0
  438. /* ============================================================================= */
  439. /* PostNetMsg:         Send a msg to the user informing them of system status    */
  440. /*                                                                               */
  441. /* ============================================================================= */
  442. PostNetMsg:          PROCEDURE EXPOSE Schedule. EchoCh
  443.   PARSE ARG Id, MsgText
  444.  
  445.  CurMsg = Schedule.Id.NickName||MsgText                         /* Build STARTING msg                   */
  446.  EchoCh||'NET SEND 'Schedule.Id.ReqId CurMsg                    /* Tell user backup is starting NOW!    */
  447.  
  448. RETURN 0
  449.  
  450. /* ============================================================================= */
  451. /* Log:       Logs data line to a execution log file                             */
  452. /*                                                                               */
  453. /* ============================================================================= */
  454. Log:           PROCEDURE EXPOSE EchoCh
  455.  PARSE ARG Line
  456.  
  457.   LogFile = 'NETBACK.LOG'                               /* Processing log file name                */
  458.   LogLine = DATE()||" "||TIME()||" - "||Line            /* Add Date/Time to output                 */
  459.   x = LINEOUT( LogFile, LogLine )                       /* Dump to log file                        */
  460.   x = LINEOUT( LogFile )                                /* Close the Log file                      */
  461. RETURN 0
  462.  
  463. /* ============================================================================= */
  464. /*    END OF FILE       END OF FILE      END OF FILE         END OF FILE         */
  465. /* ============================================================================= */
  466.  
  467.