Binary Log Backup Examples
Authentication
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}"
Binary Log Backup
One-Time Binary Log
To set up an one-time binary log backup:
```bash
curl --location 'https://api.skysql.com/skybackup/v1/backups/schedules' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'X-API-Key: ${API_KEY}' \
--data '{
"backup_type": "binarylog",
"schedule": "once",
"service_id": "$SERVICE_ID"
}'
API_KEY : SKYSQL API KEY, see MariaDB Cloud API Keys
SERVICE_ID : MariaDB Cloud serivce 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
Schedule Binary Log Backup
To set up an cron incremental backup:
curl --location 'https://api.skysql.com/skybackup/v1/backups/schedules' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'X-API-Key: ${API_KEY}' \
--data '{
"backup_type": "binarylog",
"schedule": "0 3 * * *",
"service_id": "$SERVICE_ID"
}'
API_KEY : SKYSQL API KEY, see MariaDB Cloud API Keys
SCHEDULE : Cron schedule, see Cron
SERVICE_ID : MariaDB Cloud serivce identifier, format dbtxxxxxx
Last updated
Was this helpful?