summaryrefslogtreecommitdiffstats
path: root/iredis/data/commands/bgsave.md
blob: f04d71bd481b8529d83e155fb6c0bc70f941b99f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Save the DB in background.

Normally the OK code is immediately returned. Redis forks, the parent continues
to serve the clients, the child saves the DB on disk then exits.

An error is returned if there is already a background save running or if there
is another non-background-save process running, specifically an in-progress AOF
rewrite.

If `BGSAVE SCHEDULE` is used, the command will immediately return `OK` when an
AOF rewrite is in progress and schedule the background save to run at the next
opportunity.

A client may be able to check if the operation succeeded using the `LASTSAVE`
command.

Please refer to the [persistence documentation][tp] for detailed information.

[tp]: /topics/persistence

@return

@simple-string-reply: `Background saving started` if `BGSAVE` started correctly
or `Background saving scheduled` when used with the `SCHEDULE` subcommand.

@history

- `>= 3.2.2`: Added the `SCHEDULE` option.