Configure a backup schedule for a MAAS PostgreSQL database

Configure a backup schedule for a MAAS PostgreSQL database

Warning

This configuration presupposes manual backups or backups performed by a cronjob. If you use the Backupninja backup pipeline job, see Configure the Backupninja backup pipeline.

By default, Backupninja runs daily at 1.00 AM. This section describes how to override the default configuration of the backup schedule. To enable the backup schedule in your deployment, refer to Enable a backup schedule for a MAAS PostgreSQL database using Backupninja.

To configure a backup schedule for a MAAS PostgreSQL database:

  1. Log in to the Salt Master node.

  2. Edit the cluster/infra/maas.yml file as required. Select from the following options:

    • Set the exact time of the backup server role to override the default backup time. The backup_times parameters include:

      • day_of_week

        The day of a week to perform backups. Specify 0 for Sunday, 1 for Monday, and so on. If not set, defaults to *.

      • day_of_month

        The day of a month to perform backups. For example, 20, 25, and so on. If not set, defaults to *.

        Note

        Only day_of_week or day_of_month can be active at the same time. If both are defined, day_of_week is prioritized.

      • hour

        The hour to perform backups. Uses the 24 hour format. If not defined, defaults to 1.

      • minute

        The minute to perform backups. For example, 5, 10, 59, and so on. If not defined, defaults to 00.

      Configuration example:

      parameters:
        _param:
          backupninja:
            enabled: true
            client:
              backup_times:
                day_of_week: 1
                hour: 15
                minute: 45
      

      Note

      These settings will change global Backupninja schedule. If not set differently for individual steps, it will run all steps in the right order. This is recommended way of defining exact backup order.

    • Disable automatic backups:

      parameters:
        _param:
          backupninja:
            enabled: true
            client:
              auto_backup_disabled: true
      
    • Re-enable automatic backups by setting the auto_backup_disabled parameter to false or delete the related line in cluster/infra/maas.yml:

      parameters:
        _param:
          backupninja:
            enabled: true
            client:
              auto_backup_disabled: false
      
  3. Apply changes by performing the steps 5-10 of the Enable a backup schedule for a MAAS PostgreSQL database using Backupninja procedure.