ALTER RETENTION POLICY autogen ON {{ database_name }} DURATION {{ duration }} \
REPLICATION {{ n }} SHARD DURATION {{ shard_duration }} DEFAULT
A retention policy describes the process of how InfluxDB discards old data by {{ duration }}, how many copies of this data are stored in the cluster {{ n }}. Once the data is expired it will be dropped from the database, but not one data at a time - InfluxDB will drop entire Shard Group. Time range covered by {{ shard_duration }} specifies interval at which a Shard Group will be deleted from database
When you create a database, InfluxDB automatically creates a retention policy called autogen with an infinite duration, a replication factor set to one, and a shard group duration set to seven days.
duration_unit = "ns" | "u" | "ยต" | "ms" | "s" | "m" | "h" | "d" | "w"