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.
const admin = require('/MarkLogic/admin.xqy'); const config = admin.getConfiguration(); const database = xdmp.database('Documents'); const 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.
const admin = require('/MarkLogic/admin.xqy'); const config = admin.getConfiguration(); const database = xdmp.database('Meters'); const 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.