English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Redis Bgrewriteaof Command

Redis Server

The Redis Bgrewriteaof command is used to asynchronously execute a rewriting operation of an AOF (AppendOnly File). The rewrite will create an optimized version of the current AOF file in terms of volume.

Even if the Bgrewriteaof execution fails, there will be no data loss, because the old AOF file will not be modified before Bgrewriteaof is successful.

Note:From Redis 2.4 Starting with, AOF rewriting is triggered by Redis itself, and BGREWRITEAOF is only used to manually trigger the rewriting operation.

Syntax

The basic syntax of the redis Bgrewriteaof command is as follows:

redis 127.0.0.1:6379> BGREWRITEAOF

Available Version

>= 1.0.0

Return Value

Feedback Information.

Online Examples

redis 127.0.0.1:6379>
Background append only file rewriting started

Redis Server