I am working as administrator in our company for more than 40 MarkLogic clusters. Each of them has different databases and sizes of databases. I would like to know if somebody has written code to create all database backups in 1 go.
At this moment I'm using an xqy script to go over all my databases and schedule a backup for each database. I schedule 5 minutes between each backup because running 2 backups simultanuously might result in inconsistent files on disk (at least that used to be in the past).
It would be nice to have the possibility to schedule a backup at cluster level (instead of database level) and that schedule should take care of creating a backup for all databases in the cluster (with an option to exclude certain databases or specifically include some databases).
This cluster backup should do a backup for the first database, wait for it to finish, then immediately start the next database backup and so on. This would reduce the total backup time. At this moment I have backup schedules that take more than an hour (from first till last backup) for a cluster that only has 5Gb of data in total :-(. The backup of the system databases already take 10 times 5 minutes waiting time.
In ML api terminology I'm thinking about something like this:
admin:cluster-weekly-backup(
$backup-dir as xs:string,
$backup-period as xs:positiveInteger,
$days as xs:string+,
$start-time as xs:time,
$max-backups as xs:unsignedLong,
$include-databases as xs:string,
$exclude-databases as xs:string,
$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(configuration)
Where in this case you either specify $include-databases or $exclude-databases, but not both. Default for $include-databases is "All" Default for $exclude-databases is "None"
If you specify 1 or more databases in "$include-databases" only those databases are being backed up If you specify 1 or more databases in "$exclude-databses" , those databases will be excluded from backup
I hope someone has already created something like this, or else can write some code for me.
My goal is to have only 1 scheduled job in a cluster for backups, that automatically includes all databases , even new databases should be backed up.
Casper