Enable a backup schedule for the Salt Master node using Backupninja

Enable a backup schedule for the Salt Master node using Backupninja

This section describes how to create a backup schedule for the Salt Master node using the Backupninja utility. By default, Backupninja runs daily at 1:00 AM.

To create a backup schedule for the Salt Master node using Backupninja:

  1. Log in to the Salt Master node.

  2. In cluster/infra/config/init.yml, verify that the following classes and parameters are present:

    classes:
    - system.backupninja.client.single
    - system.openssh.client.root
    parameters:
      _param:
        backupninja_backup_host: <IP>
      salt:
        master:
          backup: true
        minion:
          backup: true
    

    Note

    The backupninja_backup_host parameter is the IP address of the server where Backupninja runs. For example, the kvm03 node. To obtain this IP address or the host name, run salt -C 'I@backupninja:server' grains.item fqdn_ip4 or salt -C 'I@backupninja:server' grains.item fqdn respectively.

  3. In cluster/infra/backup/server.yml, verify that the following class is present:

    classes:
    - system.backupninja.server.single
    
  4. Optionally, override the default configuration of the backup schedule as described in Configure a backup schedule for the Salt Master node.

  5. Apply the salt.minion state:

    salt -C 'I@backupninja:server or I@backupninja:client' state.sls salt.minion
    
  6. Refresh grains and mine for the backupninja client node:

    salt -C 'I@backupninja:client' state.sls salt.minion.grains
    salt -C 'I@backupninja:client' mine.flush
    salt -C 'I@backupninja:client' mine.update
    
  7. Apply the backupninja state to the backupninja client node:

    salt -C 'I@backupninja:client' state.sls backupninja
    
  8. Refresh grains for the backupninja server node:

    salt -C 'I@backupninja:server' state.sls salt.minion.grains
    
  9. Apply the backupninja state to the backupninja server node:

    salt -C 'I@backupninja:server' state.sls backupninja
    

Once you perform the procedure, two backup configuration scripts should be created. By default, the scripts are stored in the /etc/backup.d/ directory and will run daily at 1:00 AM.