home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / wps / disk / psns2 / backup.cmd next >
OS/2 REXX Batch file  |  1993-03-08  |  3KB  |  52 lines

  1. /* Rexx =====================================================================*/
  2. /* Personally Safe'n'Sound Tape Backup Interface                             */
  3. /*---------------------------------------------------------------------------*/
  4. /* Author: Bruce Nash, Warwick Development Group, IBM (UK) Ltd               */
  5. /* Creation Date: 21/Feb/93                                                  */
  6. /*---------------------------------------------------------------------------*/
  7. /* (C) Copyright IBM Corp. 1993. All rights reserved.                        */
  8. /*===========================================================================*/
  9. /*---------------------------------------------------------------------------*/
  10. /* We are passed the name of the batch file                                  */
  11. /*---------------------------------------------------------------------------*/
  12. Arg BatchFileName
  13. /*---------------------------------------------------------------------------*/
  14. /* Program constants - change these for your own installation                */
  15. /*---------------------------------------------------------------------------*/
  16. TapeBackupControlFile = "E:\PSS\SYSDATA\BACKUP.BPF"
  17. /*---------------------------------------------------------------------------*/
  18. /* Get the name of the batch we're backing up to.                            */
  19. /* This is the second word in the first line of the batch.                   */
  20. /* (The first word is the drive we're backing up to).                        */
  21. /*---------------------------------------------------------------------------*/
  22. BatchLine = Linein( BatchFileName )
  23. BatchDrive = word( BatchLine, 1 )
  24. BatchName = word( BatchLine, 2 )
  25. BatchLine = Linein( BatchFileName )
  26. BatchLine = Linein( BatchFileName )
  27. /*---------------------------------------------------------------------------*/
  28. /* Scan through the batch file reading each line in turn.                    */
  29. /* Each line contains the FileName and the BackupFileName.  We must parse    */
  30. /* these and put them in a suitable format for the tape backup processor     */
  31. /*---------------------------------------------------------------------------*/
  32. Do While( BatchLine ¬= "" )
  33.    FileName = word( BatchLine, 1 )
  34.    BackupFileName = word( BatchLine, 2 )
  35.    /*------------------------------------------------------------------------*/
  36.    /* The format of an OS2TAPE line is:                                      */
  37.    /*   /b /b rhs /s "FileName"                                              */
  38.    /*------------------------------------------------------------------------*/
  39.    Call LINEOUT TapeBackupControlFile, '/b /b rhs /s "'||FileName||'"'
  40.    BatchLine = Linein( BatchFileName )
  41.    BatchLine = Linein( BatchFileName )
  42. End
  43. /*---------------------------------------------------------------------------*/
  44. /* Close the control file, and invoke the backup processor                   */
  45. /*---------------------------------------------------------------------------*/
  46. Call LINEOUT TapeBackupControlFile
  47. Call LINEOUT BatchFileName
  48. "F:\OS2TAPE\OS2TAPE BACKUP /w 1 /m 1 /n "BatchName" /f "TapeBackupControlFile
  49. "ERASE "TapeBackupControlFile
  50. "ERASE "BatchFileName
  51. exit 0
  52.