Loading TOC...

MarkLogic Server 11.0 Product Documentation
xdmp:database-backup-status

xdmp:database-backup-status(
   $jobid as xs:unsignedLong*,
   [$hostid as xs:unsignedLong*]
) as element()*

Summary

Checks the status of the outstanding backup job with the specified job ID. Returns a database backup status node defined in the job-status.xsd schema. If you don't specify a job ID for the first parameter, status for all currently running backup jobs will be returned.

Parameters
jobid A backup job ID.
hostid The ID of the host that the backup was started on.

Required Privileges

http://marklogic.com/xdmp/privileges/xdmp-database-backup-status

Usage Notes

If the host coordinating the backup restarts, information about the backup will be lost.

The structure of the data returned is as follows:

forest

The forest being backed up. There is one forest element for each forest in the backup.

This is a complex element with the following element children:

forest-name

The name of the forest.

forest-id

The forest ID.

status

The status of the forest backup. The status is one of: "queued", "in-progress", "failed", "canceled", "completed", "finishing", or "unknown".

restore-to-time

The date and time this backup was created.

journal-archiving

Is journal archiving enabled for a full backup?

journal-archive-path

Path to the associated journal archive location.

safe-restore-to-time

The date and time this backup was created.

journal-archive-lag-limit

Number of seconds the archived journal can lag the active journal.

host-name

Hostname where this forest is backup.

backup-path

Path to the backup location.

incremental-backup-path

Path to the backup location.

job-id

The job ID.

status

The status of the forest backup. The status is one of: "queued", "in-progress", "failed", "canceled", "completed", "finishing", or "unknown".

Example

let $b := xdmp:eval('xdmp:database-backup(
               xdmp:database-forests(xdmp:database("Documents")),
                     "/space/backup")')
return
xdmp:database-backup-status($b)
=> the backup status for the backup initiated in the xdmp:eval
<job:job-status xsi:schemaLocation="http://marklogic.com/xdmp/job-status job-status.xsd" xmlns:job="http://marklogic.com/xdmp/job-status" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <job:job-id>9457138413104448788</job:job-id>
  <job:status>in-progress</job:status>
  <job:forest>
    <job:forest-name>Documents</job:forest-name>
    <job:forest-id>15810433344251984001</job:forest-id>
    <job:status>in-progress</job:status>
    <job:host-name>host1.marklogic.com</job:host-name>
    <job:backup-path>/space/backup/20150807-1353536714460</job:backup-path>
    <job:incremental-backup>false</job:incremental-backup>
    <job:journal-archiving>false</job:journal-archiving>
  </job:forest>
</job:job-status>

Example

let $b := xdmp:eval('xdmp:database-incremental-backup(
               xdmp:database-forests(xdmp:database("Documents")),
                     "/space/backup","/space/incrbackup")')
return
xdmp:database-backup-status($b)
=> the backup status for the incremental backup initiated in the xdmp:eval
<job:job-status xsi:schemaLocation="http://marklogic.com/xdmp/job-status job-status.xsd" xmlns:job="http://marklogic.com/xdmp/job-status" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <job:job-id>11676716897085375508</job:job-id>
  <job:status>in-progress</job:status>
  <job:forest>
    <job:forest-name>Documents</job:forest-name>
    <job:forest-id>15810433344251984001</job:forest-id>
    <job:status>in-progress</job:status>
    <job:host-name>host1.marklogic.com</job:host-name>
    <job:backup-path>/space/backup/20150807-1353536714460</job:backup-path>
    <job:incremental-backup>true</job:incremental-backup>
    <job:incremental-backup-path>/space/incrbackup/20150807-1353536714460/20150807/1355436552150</job:incremental-backup-path>
    <job:journal-archiving>false</job:journal-archiving>
  </job:forest>
</job:job-status>

Example

xdmp:database-backup-status((), xdmp:hosts())
=>
<job:job-status xsi:schemaLocation="http://marklogic.com/xdmp/job-status job-status.xsd" xmlns:job="http://marklogic.com/xdmp/job-status" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <job:job-id>7138588173658949103</job:job-id>
  <job:status>completed</job:status>
  <job:forest>
    <job:forest-name>Documents</job:forest-name>
    <job:forest-id>15810433344251984001</job:forest-id>
    <job:status>completed</job:status>
    <job:host-name>host1.marklogic.com</job:host-name>
    <job:backup-path>/space/backup/20150807-1356535579770</job:backup-path>
    <job:incremental-backup>false</job:incremental-backup>
    <job:journal-archiving>false</job:journal-archiving>
  </job:forest>
  <job:forest>
    <job:forest-name>Security</job:forest-name>
    <job:forest-id>14856907692299796171</job:forest-id>
    <job:status>completed</job:status>
    <job:host-name>host1.marklogic.com</job:host-name>
    <job:backup-path>/space/backup/20150807-1356535579770</job:backup-path>
    <job:incremental-backup>false</job:incremental-backup>
    <job:journal-archiving>false</job:journal-archiving>
  </job:forest>
  <job:forest>
    <job:forest-name>Schemas</job:forest-name>
    <job:forest-id>18265087540925870633</job:forest-id>
    <job:status>completed</job:status>
    <job:host-name>host1.marklogic.com</job:host-name>
    <job:backup-path>/space/backup/20150807-1356535579770</job:backup-path>
    <job:incremental-backup>false</job:incremental-backup>
    <job:journal-archiving>false</job:journal-archiving>
  </job:forest>
  <job:forest>
    <job:forest-name>Triggers</job:forest-name>
    <job:forest-id>16709030055805263427</job:forest-id>
    <job:status>completed</job:status>
    <job:host-name>host1.marklogic.com</job:host-name>
    <job:backup-path>/space/backup/20150807-1356535579770</job:backup-path>
    <job:incremental-backup>false</job:incremental-backup>
    <job:journal-archiving>false</job:journal-archiving>
  </job:forest>
</job:job-status>

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