home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Backup / Backup.zip / bacrest.zip / DBEXIT.CMD < prev    next >
OS/2 REXX Batch file  |  1997-07-28  |  3KB  |  53 lines

  1. /* Rexx */
  2. /***************************************************************************/
  3. /* Warp Server Backup/Restore Database Backup User Exit                    */
  4. /*                                                                         */
  5. /*      Copyright  1996  IBM Corp.                                         */
  6. /*-------------------------------------------------------------------------*/
  7. /* Parameters passed:                                                      */
  8. /*   Complete         = 0 at the start of a backup                         */
  9. /*                    = 1 at the end of a backup                           */
  10. /*                                                                         */
  11. /*   BkMethod         = Name of the Backup Method used in the backup       */
  12. /*                                                                         */
  13. /*   BkpSet           = Name of the Backup Set being backed up to          */
  14. /*                                                                         */
  15. /*   Incremental      = 0 for a full backup                                */
  16. /*                    = 1 for an incremental backup                        */
  17. /*                                                                         */
  18. /*   Manual           = 0 for a manual backup                              */
  19. /*                    = 1 for an automatic backup                          */
  20. /***************************************************************************/
  21. Parse arg Complete' <'BkMethod'> <'BkpSet'>' Incremental Manual
  22. /*-------------------------------------------------------------------------*/
  23. /* Check the Complete flag to determine whether this is the beginning or   */
  24. /* end of a backup                                                         */
  25. /*-------------------------------------------------------------------------*/
  26. If Complete = 0 Then Do
  27.    /*----------------------------------------------------------------------*/
  28.    /* We're at the beginning of a backup, so now's the time call the       */
  29.    /* DB/2 database backup function.                                       */
  30.    /*----------------------------------------------------------------------*/
  31.    /*----------------------------------------------------------------------*/
  32.    /* We can check the Backup Method to make sure this is a Database       */
  33.    /* backup, and if it is, start the database manager and create the      */
  34.    /* backup file.                                                         */
  35.    /*----------------------------------------------------------------------*/
  36.    If BkMethod = "Base de données" Then Do
  37.       '@md c:\dbback'
  38.       '@db2 start database manager'
  39.       '@db2 backup database sample to c:\dbback'
  40.    End
  41. End /* enddo */
  42. Else Do
  43.    /*----------------------------------------------------------------------*/
  44.    /* The backup has finished, so now we can delete the database backup    */
  45.    /* file (provided this is a Database backup that is).                   */
  46.    /*----------------------------------------------------------------------*/
  47.    If BkMethod = "Base de données" Then Do
  48.       Call RxFuncAdd 'SysDestroyObject', 'RexxUtil', 'SysDestroyObject'
  49.       SysDestroyObject("c:\dbback")
  50.    End
  51. End
  52. return 0
  53.