Log backups are a core part of your data protection strategy for ApsaraDB RDS for MySQL. When log backup is enabled, local binary logs are continuously uploaded to backup storage in real time, allowing you to restore your database to any point in time within the retention period—accurate to the second.
This topic describes how to enable, view, and manage log backups.
Billing
The log backup feature itself is free. However, log backup files consume backup storage, and you are charged for that storage. A free quota is included with each instance. Charges apply only when the total size of data backups and log backups exceeds the free quota. For pricing details and quota calculation, see Backup Guide.
How it works
Understanding the distinction between log backups and local binary logs helps you configure and troubleshoot the feature correctly.
| Log backup | Local binary log | |
|---|---|---|
| What it is | Binary log files uploaded to backup storage | Binary log files on the instance disk |
| Location | Backup storage (separate from instance storage) | Instance storage |
| Purpose | Point-in-time recovery within the retention period | Short-term local recovery |
| Controlled by | Log backup toggle in Backup and Restoration | Local log retention period setting |
| View with | Backup list in the console | SHOW BINARY LOGS; command |
Disabling log backup stops uploads to backup storage and deletes all existing log backup sets within 1 to 3 minutes. It does not delete local binary log files on the instance disk—those remain until the local log retention period expires.
Enable or disable log backups
-
Go to the Instances page. In the top navigation bar, select the region where your RDS instance resides, then click the instance ID.
-
In the left navigation pane, click Backup and Restoration.
-
Click the Backup Strategy tab.
-
In the Basic Backup section, click Edit to enable or disable log backups.
Log backup settings (Standard)
| Parameter | Description |
|---|---|
| Log Backup | Enables point-in-time recovery (PITR). Enabled by default. |
| Log Backup Retention Period (Days) | How long log backups are retained. Valid values: 7–730 days. Default: 7 days. Must be less than or equal to the data backup retention period. For instances running MySQL 5.7 on Basic Edition, the value is fixed at 7 days. |
Point-in-time recovery settings (Enhanced)
Enhanced PITR is available only in select regions. For supported regions, requirements, and a comparison with standard log backup, see Set a point-in-time recovery policy.
Enabling point-in-time recovery causes the instance to retain certain backup sets beyond the Log Backup Retention Period. For example, with a 7-day retention period, backup data is actually kept for 7 to 9 days. The system retains the most recent full backup older than seven days and all subsequent log backups. You are charged for only one full backup and up to one extra week of log backups.
| Parameter | Description |
|---|---|
| Restoration to Specific Point in Time | Enables the PITR feature. After enabling, you can restore your RDS instance to any point in time. This is an enhancement of log backup. Enabled by default for new RDS instances. |
| Time Range of Specific Points in Time for Restoration | The number of days within which you can restore to any point in time. Modifying this value also changes the log backup retention period. Valid values: 7–730 days. Default: 7 days. Must be less than or equal to the full backup retention period. Fixed at 7 for instances running MySQL 5.7 on Basic Edition. |
After you disable log backups, the system automatically deletes all existing log backup sets within 1 to 3 minutes. Deleted log backup sets cannot be recovered. Proceed with caution.
View log backups
-
Go to the Instances page. In the top navigation bar, select the region where your RDS instance resides, then click the instance ID.
-
In the left navigation pane, click Backup and Restoration.
-
Click Base Backups > Log Backup.
For High-availability Edition and Enterprise Edition instances, both the primary and secondary nodes have log backups. In the backup list, each backup is identified by File Location Instance ID to indicate which node it belongs to.
View the size of log backups
-
Go to the Instances page. In the top navigation bar, select the region where your RDS instance resides, then click the instance ID.
-
On the Basic Information page, find the Instance Resources section to view the log backup size.
Log backups are stored in backup storage and do not consume your instance's storage space. Backup storage is not publicly accessible.
After a minor version update of an RDS for MySQL Basic Edition instance, Backup Usage on the Basic Information page may temporarily show 0. The value is restored automatically after the next scheduled backup completes.
Delete log backups
Download log backups
See Download backups.
Restore data to a point in time
With log backup enabled, you can restore your database to any second within the retention period. See Restore full data or Restore databases and tables.
FAQ
The log backup page is empty. What's wrong?
Two situations cause this. First, log backup may be disabled—go to Backup and Restoration > Backup Strategy and check the Log Backup toggle. Second, if you just enabled log backup or created the instance, local logs haven't been uploaded yet. Wait a few minutes and refresh.
Why can't I see the latest logs on the log backup page?
The page shows only fully written log files. Files that are currently being written remain on the instance disk and haven't been uploaded to backup storage yet. They'll appear after the write completes.
My retention period is 7 days. Can I retrieve logs older than 7 days?
No. Backups older than the retention period are automatically deleted. Set a retention period that covers your expected recovery needs before you need it.
Are log backups free?
The feature is free, but log backup files consume backup storage, which is charged. A free storage quota is included with each instance. When the total size of data backups and log backups exceeds the free quota, you are charged for the excess. See Backup Guide for quota details.
Why did my log backup size suddenly increase?
Frequent INSERT, UPDATE, or DELETE operations generate more binary log data, which increases log backup size. To free up storage, see Delete or reduce backups.
I only want to keep local binary log files, not log backups. What should I do?
Disable log backup, then configure the local log retention period separately. See Set Local Log Policy.
After disabling log backups, `SHOW BINARY LOGS;` still shows log files. Why?
SHOW BINARY LOGS; lists local binary log files on the instance disk, not log backup files in backup storage. These are different. Disabling log backup stops uploads to backup storage but does not delete local binary logs. To delete local binary log files, see Delete binary log files.
Why wasn't storage released after I disabled log backups?
Log backups don't consume your instance's storage space—local binary logs do. Disabling log backup frees backup storage (after the 1–3 minute deletion window), but local logs remain on the instance disk and continue to consume instance storage until they expire.
Next steps
-
To modify data backup and log backup policies, see Set automatic backup policy.
-
To understand how local binary logs differ from log backups and how local logs are generated, see Manage local logs (Binlog).
API reference
-
DescribeBackupPolicy — View the current backup settings for an instance.
-
ModifyBackupPolicy — Modify the data backup or log backup policy for an instance.