delete backup {--backupid=|-I }backup_id [--skip-nodeid=nodeid-list] cluster_name
nodeid-list:
nodeid[, nodeid[, ...]]
For MySQL Cluster Manager 8.0.28 and later: The command
removes a backup's directories and their contents on both data
nodes and mysqld nodes of the cluster named
cluster_name
:
mcm> list backups mycluster;
+----------+--------+---------+----------------------+-------+---------+
| BackupId | NodeId | Host | Timestamp | Parts | Comment |
+----------+--------+---------+----------------------+-------+---------+
| 1 | 1 | flundra | 2018-04-04 06:31:12Z | 1 | |
| 1 | 2 | tonfish | 2018-04-04 06:31:12Z | 1 | |
+----------+--------+---------+----------------------+-------+---------+
2 rows in set (0.04 sec)
mcm> delete backup --backupid=1 mycluster;
+-----------------------------+
| Command result |
+-----------------------------+
| Backup deleted successfully |
+-----------------------------+
1 row in set (1.22 sec)
mcm> list backups mycluster;
+----------+--------+---------+----------------------+-------+------------------+
| BackupId | NodeId | Host | Timestamp | Parts | Comment |
+----------+--------+---------+----------------------+-------+------------------+
| None | 2 | tonfish | | | No backups found |
| None | 1 | flundra | | | No backups found |
+----------+--------+---------+----------------------+-------+------------------+
2 rows in set (0.09 sec)
The ID of the backup to be deleted must be specified using the
--backupid
option.
To delete all backups, run the command on every single backup.
If any data nodes or mysqld nodes have been
added after the specified backup was created, list their node
IDs with the
--skip-nodeid
option, or the operation will fail with the complaint that no
backup directories exist on those nodes.
The command fails if there are files other than the backup files in any of the backup directories to be deleted. Remove those extra files manually before running the command.