mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-16 05:46:52 +00:00
Purge recorder data by default, allow repack (#4643)
This commit is contained in:
parent
9329aa74cc
commit
f566a97641
@ -38,9 +38,10 @@ recorder:
|
|||||||
purge_keep_days:
|
purge_keep_days:
|
||||||
description: Specify the number of history days to keep in recorder database after a purge.
|
description: Specify the number of history days to keep in recorder database after a purge.
|
||||||
required: false
|
required: false
|
||||||
|
default: 10
|
||||||
type: int
|
type: int
|
||||||
purge_interval:
|
purge_interval:
|
||||||
description: How often (in days) the purge task runs. If a scheduled purge is missed (e.g., if Home Assistant was not running), the schedule will resume soon after Home Assistant restarts. You can use the [service](#service-purge) call `purge` when required without impacting the purge schedule. If this is set to `0` (zero), purging is disabled.
|
description: How often (in days) the purge task runs. If a scheduled purge is missed (e.g., if Home Assistant was not running), the schedule will resume soon after Home Assistant restarts. You can use the [service](#service-purge) call `purge` when required without impacting the purge schedule. If this is set to `0` (zero), automatic purging is disabled.
|
||||||
required: false
|
required: false
|
||||||
default: 1
|
default: 1
|
||||||
type: int
|
type: int
|
||||||
@ -122,16 +123,12 @@ If you only want to hide events from e.g. your history, take a look at the [`his
|
|||||||
|
|
||||||
### {% linkable_title Service `purge` %}
|
### {% linkable_title Service `purge` %}
|
||||||
|
|
||||||
Call the service `recorder.purge` to start purge task, which deletes events and states older than x days, according to `keep_days` service data (*Required*)
|
Call the service `recorder.purge` to start a purge task which deletes events and states older than x days, according to `keep_days` service data.
|
||||||
|
|
||||||
Automation [action](https://home-assistant.io/getting-started/automation-action/) example:
|
| Service data attribute | Optional | Description |
|
||||||
|
| ---------------------- | -------- | ----------- |
|
||||||
```yaml
|
| `keep_days` | yes | The number of history days to keep in recorder database (defaults to the component `purge_keep_days` configuration)
|
||||||
action:
|
| `repack` | yes | Rewrite the entire database, possibly saving some disk space (only supported for SQLite)
|
||||||
service: recorder.purge
|
|
||||||
data:
|
|
||||||
keep_days: 5
|
|
||||||
```
|
|
||||||
|
|
||||||
### {% linkable_title Restore State %}
|
### {% linkable_title Restore State %}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user