Redis BGREWRITEAOF command instructs Redis to start an Append Only File rewrite process. The rewrite will create a small optimized version of the current Append Only File. If BGREWRITEAOF fails, no data gets lost as the old AOF will be untouched. The rewrite will be only triggered by Redis, if there is not already a background process doing persistence.
Simple string reply: always OK.
Following is the basic syntax of Redis BGREWRITEAOF command.
redis 127.0.0.1:6379> BGREWRITEAOF