Skip to content
This repository has been archived by the owner on Aug 27, 2019. It is now read-only.

Backup Database Example

zerovian edited this page Jun 27, 2019 · 8 revisions

Following is an example of how to use the Backup Database task

    import io.gitlab.grabl.*
    apply plugin: 'io.gitlab.grabl.grabl'
    apply plugin: 'base'


    task createDB(type: CreateDatabase) {
        dbName = "sports2020"
        destDir = "${buildDir}/db"
        sourceDb = "$System.env.DLC/sports2020"
        largeFiles = true
    }


    task backupDatabase(type: BackupDatabase) {
        dependsOn createDB

        source = "${buildDir}/db/sports2020.db"
        target = "${buildDir}/db/sports2020.bk"
        overwrite = true
    }

    build {
        dependsOn backupDatabase
    }

    clean {
        delete "${buildDir}"
    }

    defaultTasks 'clean', 'build'

Backup database supports the following properties

Property Description
source Required. Path to the database where the .db is located
target Required. Path of the backup file for the database.
overwrite Optional. Defaults to false. Overwrite the target file if it exists. If this isn't specified, and the file already exists, the build will fail
online Optional. Indicates the database must be online or not when doing a backup. If not set, proutil -C holder will be used to detect database is up. Leave this out if you want the task to auto detect if this option should be used.
incremental Optional. Performs an incremental backup.
DLC Optional. Path to where OpenEdge installation is located. If not specified, the $DLC environment variable will be used.
Clone this wiki locally