admin.databaseDailyBackup( backup-dir as String, backup-period as Number, start-time as (Number|String), max-backups as (Number|String), backup-security-db as Boolean, backup-schemas-db as Boolean, backup-triggers-db as Boolean, [include-replicas as Boolean], [journal-archiving as Boolean?], [journal-archive-path as String?], [lag-limit as (Number|String)?] ) as element(db.databaseBackup)
This function constructs a daily scheduled database backup specification.
var admin = require('/MarkLogic/admin.xqy'); var config = admin.getConfiguration(); var database = xdmp.database('Documents'); var backup = admin.databaseDailyBackup('/backup-dir', 2, '19:45:00',10,true,true,true); admin.databaseAddBackup(config, database, backup) // Returns the new configuration element -- use admin.saveConfiguration to save // the changes to the configuration or pass the configuration to other Admin API // functions to make other changes.
var admin = require('/MarkLogic/admin.xqy'); var config = admin.getConfiguration(); var database = xdmp.database('Meters'); var backup = admin.databaseDailyBackup('/backup-dir2', 2, '01:00:00',8,false,false,false,false,true,'/journals/archives'); admin.databaseAddBackup(config, database, backup) // Returns the new configuration element -- use admin.saveConfiguration to save // the changes to the configuration or pass the configuration to other Admin API // functions to make other changes.
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.