Update database backup

Update an existing database backup configuration.


PATCH/api/backups/database/{id}

Update database backup

This endpoint allows you to update an existing database backup configuration.

Required parameters

  • Name
    interval
    Type
    integer
    Description

    Must be either of these values: 0, 10, 20, 30, 40, 50, 60, 120, 240, 480, 720, 1440, 10080, 43800 (0 = nightly, the rest is each minute).

  • Name
    keep_backup_amount
    Type
    integer
    Description

    This is used to determine how many backups should be saved.

Optional parameters

  • Name
    deleteOnFail
    Type
    boolean
    Description

    Whether to delete the backup file if the backup process fails.

  • Name
    custom_name
    Type
    string
    Description

    This is used to define a custom archive name.

  • Name
    path
    Type
    string
    Description

    This is used for storage drivers to determine which path the backup should be put in (required for aws-s3, digitalocean-spaces, custom-s3, sftp, ftp, local drivers).

  • Name
    compression
    Type
    string
    Description

    The compression type to use for the backup (e.g., zip, gzip).

  • Name
    excluded
    Type
    array
    Description

    An array of table names you do not want to include in the backup.

  • Name
    locations
    Type
    string
    Description

    This is only used for google-drive driver to determine which folder backups should be put in.

Request

PATCH
/api/backups/database/{id}
curl -X PATCH "https://ploi.io/api/backups/database/{id}" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "interval": 120,
    "keep_backup_amount": 10,
    "deleteOnFail": true,
    "custom_name": "my-backup.zip",
    "path": "/backups",
    "compression": "gzip",
    "excluded": ["sessions", "cache"],
    "locations": "production-backups"
  }'

Response

{
  "data": {
    "id": 1,
    "type": "local",
    "path": "/backups",
    "compression": "gzip",
    "interval": 120,
    "keep_backup_amount": 10,
    "custom_name": "my-backup.zip",
    "delete_on_fail": true,
    "excluded": ["sessions", "cache"],
    "locations": "production-backups",
    "status": "active",
    "last_backup_at": null,
    "next_backup_at": "2025-01-15T12:00:00.000000Z",
    "created_at": "2025-01-14T10:30:00.000000Z",
    "server": {
      "id": 1,
      "name": "Production Server",
      "status_id": 1,
      "ip": "192.168.1.1",
      "tags": ["production"]
    },
    "database": {
      "id": 1,
      "name": "my_database",
      "status_id": 1
    },
    "backup_configuration": {
      "id": 1,
      "label": "Local Backups",
      "type": "local"
    }
  }
}