diff --git a/src/main/asciidoc/_chapters/backup_restore.adoc b/src/main/asciidoc/_chapters/backup_restore.adoc index c2beca0b9aee..d05067a46c81 100644 --- a/src/main/asciidoc/_chapters/backup_restore.adoc +++ b/src/main/asciidoc/_chapters/backup_restore.adoc @@ -578,33 +578,60 @@ $ hbase backup describe backupId_1467823988425 // hbase backup delete [[br.delete.backup]] -=== Deleting a Backup Image +=== Deleting Backup Images -This command can be used to delete a backup image which is no longer needed. +The `hbase backup delete` command deletes backup images that are no longer needed. + +[[br.delete.backup.syntax]] +==== Syntax [source] ---- -$ hbase backup delete +$ hbase backup delete -l +$ hbase backup delete -k ---- -[[br.delete.backup.positional.cli.arguments]] -==== Positional Command-Line Arguments - -_backup_id_:: - The ID to the backup image which should be deleted. - [[br.delete.backup.named.cli.arguments]] ==== Named Command-Line Arguments -None. +_-l _:: +Comma-separated list of backup IDs to delete. + +_-k _:: +Deletes all backup images completed more than the specified number of days ago. + +NOTE: These options are **mutually exclusive**. Only one of `-l` or `-k` may be used at a time. [[br.delete.backup.example]] -==== Example usage +==== Example Usage + +Delete specific backup images by ID: [source] ---- -$ hbase backup delete backupId_1467823988425 +$ hbase backup delete -l backupId_1467823988425,backupId_1467824989999 +---- + +Delete all backup images older than 30 days: + +[source] ---- +$ hbase backup delete -k 30 +---- + +[CAUTION] +==== +* Deleting a backup may affect all following incremental backups (in the same backup root) up to + the next full backup. For example, if you take a full backup every 2 weeks and + daily incremental backups, running `hbase backup delete -k 7` when the full backup is older than + 7 days will effectively remove the data for all subsequent incremental backups. + The backup IDs may still be listed, but their data will be gone. + +* If the most recent backup is an incremental backup and you delete it, + you should run a **full backup** next. + Running another incremental backup immediately after may result in missing data in the + backup image. (See link:https://issues.apache.org/jira/browse/HBASE-28084[HBASE-28084]) +==== // hbase backup repair