admin:database-daily-backup( $backup-dir as xs:string, $backup-period as xs:positiveInteger, $start-time as xs:time, $max-backups as xs:unsignedLong, $backup-security-db as xs:boolean, $backup-schemas-db as xs:boolean, $backup-triggers-db as xs:boolean, [$include-replicas as xs:boolean], [$journal-archiving as xs:boolean?], [$journal-archive-path as xs:string?], [$lag-limit as xs:unsignedLong?] ) as element(db:database-backup)
This function constructs a daily scheduled database backup specification.
xquery version "1.0-ml"; import module namespace admin = "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy"; let $config := admin:get-configuration() return admin:database-daily-backup("/backup-dir", 2, xs:time("19:45:00"),10,true(),true(),true()) (: returns the daily database backup specification :)
xquery version "1.0-ml"; import module namespace admin = "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy"; let $config := admin:get-configuration() let $database := xdmp:database("Documents") let $backup := admin:database-daily-backup("/backup-dir", 2, xs:time("19:45:00"),10,true(),true(),true()) return admin:database-add-backup($config, $database, $backup) (: returns the new configuration element -- use admin:save-configuration to save the changes to the configuration or pass the configuration to other Admin API functions to make other changes. :)
xquery version "1.0-ml"; import module namespace admin = "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy"; let $config := admin:get-configuration() return admin:database-daily-backup("/backup-dir", 2, xs:time("19:45:00"),10,true(),true(),true(),false(),true(),(),500) (: returns the daily database backup specification :)
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.