Skip to content

Ask the HotKV docs

Answers come only from these docs and can be wrong; check the linked pages before you rely on them.

BGSAVE

Last updated
BGSAVE [SCHEDULE]
Group
Server
Complexity
O(1) to start; the save itself is O(N) in the number of keys
Arity
-1 (at least 1 words, counting the command name)
Flags
admin
HotKV Cloud
All plans
On-Premise
no license needed

BGSAVE starts writing a point-in-time snapshot of every database to the snapshot file (dbfilename in dir) and replies right away. Clients keep being served while the snapshot is written. Check progress with rdb_bgsave_in_progress and the result with rdb_last_bgsave_status in INFO persistence, or wait for LASTSAVE to change.

The server also starts background saves on its own according to the save setting.

Option Effect
SCHEDULE Accepted for compatibility. In Redis it delays the save while an AOF rewrite runs; in HotKV a rewrite does not stop a background save, so it starts at once either way.
Case Reply (RESP2 and RESP3)
Save started Simple string Background saving started
A background save is already running Error ERR Background save already in progress
Any other argument Error ERR syntax error
127.0.0.1:6379> BGSAVE
Background saving started
127.0.0.1:6379> BGSAVE
(error) ERR Background save already in progress

In HotKV Cloud, the CLI tab of the panel does not run BGSAVE. Send it from your own client connection.

Same replies as Redis 7 and Valkey 8, except that SCHEDULE never delays the save.

SAVE, LASTSAVE, BGREWRITEAOF, persistence