Loading TOC...

MarkLogic 10 Product Documentation
admin.databaseBackupSetEnabled

admin.databaseBackupSetEnabled(
   config as element(configuration),
   database-id as (Number|String),
   backup-id as (Number|String),
   enabled as Boolean
) as element(configuration)

Summary

This function enables database backup for the specified database.

Parameters
config A configuration specification, typically as returned from one of the Admin module functions.
database-id The ID for the database (for example, xdmp.database("myDatabase")).
backup-id The ID of the backup, found by XPath to the backup location(for example, //db:backup-id/).
enabled Sets the database backup to enabled. The default is true, which means the database backup will take place.

Required Privileges

This operation requires at least one of the following privileges:

http://marklogic.com/xdmp/privileges/admin/database

http://marklogic.com/xdmp/privileges/admin/database/backup

http://marklogic.com/xdmp/privileges/admin/database/backup/{id}

Example


  let admin = require("/MarkLogic/admin.xqy")
  let backupIds = fn.head(admin.databaseGetBackups(
    admin.getConfiguration(), xdmp.database("Documents"))).xpath("db:backup-id/fn:data()", {"db": "http://marklogic.com/xdmp/database"})
  admin.databaseBackupSetEnabled(admin.getConfiguration(), xdmp.database("Documents"), backupIds, true)
    

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.