For the complete documentation index, see llms.txt. This page is also available as Markdown.

Snapshot Backup Examples

Snapshot backup examples for MariaDB Cloud via the SkySQL Backup API: one-time and scheduled point-in-time persistent-volume snapshots for fast database restoration.

Go to the MariaDB Cloud API Key management page and generate an API key. Export the value from the token field to an environment variable $API_KEYexport API_KEY='... key data ...'

Use it on subsequent request, e.g: bash curl --request

GET 'https://api.skysql.com/skybackup/v1/backups/schedules' \
    --header "X-API-Key: ${API_KEY}"

Snapshot Backup Scheduling

One-Time Snapshot Example

Example: Creating a One-time Snapshot Backup

To create a one-time snapshot backup using the SkySQL API, use the following curl command:

curl --location 'https://api.skysql.com/skybackup/v1/backups/schedules' \
     --header 'Content-Type: application/json' \
     --header 'X-API-Key: $API_KEY' \
     --data '{
         "backup_type": "snapshot",
         "schedule": "once",
         "service_id": "$SERVICE_ID"
     }'
  • backup_type: Specifies the type of backup. In this case, it is set to "snapshot".

  • schedule: Indicates the backup schedule. Here, it is set to "once" for a one-time execution.

  • service_id: The unique identifier for the service you want to back up.

Ensure to replace $API_KEY and $SERVICE_ID with your actual API key and service ID values.

  • API_KEY : SKYSQL API KEY, see MariaDB Cloud API Keys

  • SERVICE_ID : MariaDB Cloud service identifier, format dbtxxxxxx. You can fetch the service ID from the Fully qualified domain name(FQDN) of your service. E.g: in dbpgf17106534.sysp0000.db2.skysql.com, 'dbpgf17106534' is the service ID.You will find the FQDN in the Connect window

Cron Snapshot Example

  • API_KEY : SKYSQL API KEY, see MariaDB Cloud API Keys

  • SCHEDULE : Cron schedule, see Cron

  • SERVICE_ID : MariaDB Cloud service identifier, format dbxxxxxx

Backup status can be fetched using 'https://api.skysql.com/skybackup/v1/backups'. See the 'Backup Status' section for an example.

This page is: Copyright © 2026 MariaDB. All rights reserved.

Last updated

Was this helpful?