marklogicml-gradle

ml-gradle deploy database backup schedule only


Is there a way to only deploy database backup schedule without apply other database configuration?

I added a backup-config directory with only the database backup schedule but ml-gradle created two additional forests for that database.

gradle.properties

mlConfigPaths=src/main/backup-config
BACKUP-DIR=s3://bucket/database-backups

the backup schedule is in

src/main/backup-config/databases/database.json

backup schedule:

    {
      "backup-enabled": true,
      "backup-directory": "%%BACKUP-DIR%%/database/",
      "backup-type": "weekly",
      "backup-period": 1,
      "backup-day": [
          "saturday"
      ],
      "backup-start-time": "10:00:00",
      "max-backups": 1,
      "backup-security-database": false,
      "backup-schemas-database": false,
      "backup-triggers-database": false,
      "include-replicas": false,
      "incremental-backup": false,
      "journal-archiving": false,
      "journal-archive-path": "",
      "purge-journal-archive": false,
      "journal-archive-lag-limit": 15
    }

Solution

  • If you have the rest of your config in src/main/ml-config, you can run ./gradlew mlDeploy -PmlConfigPaths=src/main/backup-config and only files in your "backup-config" directory will be processed. That allows you to only put "database-name" and your backup config in that file.