Easy Tutorial
❮ Hashes Hvals Sets Sscan ❯

Redis Bgrewriteaof Command

Redis Server

The Redis Bgrewriteaof command is used to asynchronously perform a rewrite of the AOF (AppendOnly File). The rewrite creates a size-optimized version of the current AOF file.

Even if the Bgrewriteaof fails, no data will be lost, as the old AOF file is not modified until Bgrewriteaof succeeds.

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

Syntax

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

redis 127.0.0.1:6379> BGREWRITEAOF

Available Versions

= 1.0.0

Return Value

Response message.

Example

redis 127.0.0.1:6379>
Background append only file rewriting started

Redis Server

❮ Hashes Hvals Sets Sscan ❯