Update site file backup

Update an existing site file backup.


PATCH/api/backups/file/{id}

Update site file backup

This endpoint allows you to update an existing site file backup configuration.

Required parameters

  • Name
    interval
    Type
    integer
    Description

    Must be either of these values: 0, 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.

  • Name
    path
    Type
    string
    Description

    The path on the server to backup (must start with /home/system_user/root_domain).

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
    local_path
    Type
    string
    Description

    For local driver, the destination path where the backup should be stored (must start with /).

  • 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 directories or files you do not want to include in the backup (e.g., node_modules, vendor).

  • 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/file/{id}
curl -X PATCH "https://ploi.io/api/backups/file/1" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "interval": 720,
    "keep_backup_amount": 5,
    "path": "/home/ploi/example.com/public",
    "deleteOnFail": false,
    "custom_name": "site-backup.zip",
    "local_path": "/backups/sites",
    "compression": "zip",
    "excluded": ["node_modules", "vendor", ".git"],
    "locations": "production-sites"
  }'

Response

{
  "data": {
    "id": 1,
    "type": "local",
    "path": "/home/ploi/example.com/public",
    "local_path": "/backups/sites",
    "compression": "zip",
    "interval": 720,
    "keep_backup_amount": 5,
    "custom_name": "site-backup.zip",
    "delete_on_fail": false,
    "excluded": ["node_modules", "vendor", ".git"],
    "locations": "production-sites",
    "status": "active",
    "last_backup_at": null,
    "next_backup_at": "2025-01-15T12:00:00.000000Z",
    "created_at": "2025-01-14T10:30:00.000000Z",
    "site": {
      "id": 1,
      "root_domain": "example.com",
      "server_id": 1,
      "server": {
        "id": 1,
        "name": "Production Server",
        "status_id": 1,
        "ip": "192.168.1.1"
      }
    },
    "backup_configuration": {
      "id": 1,
      "label": "Local Backups",
      "type": "local"
    }
  }
}