{
  "schema_version": 2,
  "id": "commands/bgsave",
  "title": "BGSAVE",
  "url": "https://redis.io/docs/latest/commands/bgsave/",
  "summary": "Asynchronously saves the database(s) to disk.",
  "since": "1.0.0",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-09-18T09:48:09+01:00",
  "page_type": "content",
  "content_hash": "3710e762b8d6428d2a8e9b8909bf5f720f114423e61affd0f5a7a4879d09c68c",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Save the DB in background.\n\nNormally the OK code is immediately returned.\nRedis forks, the parent continues to serve the clients, the child saves the DB\non disk then exits.\n\nAn error is returned if there is already a background save running or if there\nis another non-background-save process running, specifically an in-progress AOF\nrewrite.\n\nIf `BGSAVE SCHEDULE` is used, the command will immediately return `OK` when an\nAOF rewrite is in progress and schedule the background save to run at the next\nopportunity.\n\nA client may be able to check if the operation succeeded using the [`LASTSAVE`](https://redis.io/docs/latest/commands/lastsave)\ncommand.\n\nSee the [persistence documentation](https://redis.io/docs/latest/operate/oss_and_stack/management/persistence) for detailed information."
    },
    {
      "id": "optional-arguments",
      "title": "Optional arguments",
      "role": "parameters",
      "text": "<details open><summary><code>SCHEDULE</code></summary>\n\nSchedule the save to run after any in-progress `BGSAVE` finishes, instead of returning an error.\n\n</details>"
    },
    {
      "id": "redis-software-and-redis-cloud-compatibility",
      "title": "Redis Software and Redis Cloud compatibility",
      "role": "content",
      "text": "| Redis<br />Software | Redis<br />Cloud | <span style=\"min-width: 9em; display: table-cell\">Notes</span> |\n|:----------------------|:-----------------|:------|\n| <span title=\"Not supported\">&#x274c; Standard</span><br /><span title=\"Not supported\"><nobr>&#x274c; Active-Active</nobr></span> | <span title=\"Not supported\">&#x274c; Standard</span><br /><span title=\"Not supported\"><nobr>&#x274c; Active-Active</nobr></span> |  |"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\nOne of the following:\n* [Simple string reply](../../develop/reference/protocol-spec#simple-strings): `Background saving started`.\n* [Simple string reply](../../develop/reference/protocol-spec#simple-strings): `Background saving scheduled`.\n\n**RESP3:**\n\nOne of the following:\n* [Simple string reply](../../develop/reference/protocol-spec#simple-strings): `Background saving started`.\n* [Simple string reply](../../develop/reference/protocol-spec#simple-strings): `Background saving scheduled`."
    }
  ],
  "examples": []
}
