Skip to content

Commit f566a97

Browse files
amelchioarsaboo
authored andcommitted
Purge recorder data by default, allow repack (home-assistant#4643)
1 parent 9329aa7 commit f566a97

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

source/_components/recorder.markdown

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ recorder:
3838
purge_keep_days:
3939
description: Specify the number of history days to keep in recorder database after a purge.
4040
required: false
41+
default: 10
4142
type: int
4243
purge_interval:
43-
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.
44+
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.
4445
required: false
4546
default: 1
4647
type: int
@@ -122,16 +123,12 @@ If you only want to hide events from e.g. your history, take a look at the [`his
122123

123124
### {% linkable_title Service `purge` %}
124125

125-
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*)
126+
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.
126127

127-
Automation [action](https://home-assistant.io/getting-started/automation-action/) example:
128-
129-
```yaml
130-
action:
131-
service: recorder.purge
132-
data:
133-
keep_days: 5
134-
```
128+
| Service data attribute | Optional | Description |
129+
| ---------------------- | -------- | ----------- |
130+
| `keep_days` | yes | The number of history days to keep in recorder database (defaults to the component `purge_keep_days` configuration)
131+
| `repack` | yes | Rewrite the entire database, possibly saving some disk space (only supported for SQLite)
135132

136133
### {% linkable_title Restore State %}
137134

0 commit comments

Comments
 (0)