1<refentry id="repmgr-cluster-cleanup">
2  <indexterm>
3    <primary>repmgr cluster cleanup</primary>
4  </indexterm>
5 <refmeta>
6    <refentrytitle>repmgr cluster cleanup</refentrytitle>
7  </refmeta>
8
9  <refnamediv>
10    <refname>repmgr cluster cleanup</refname>
11    <refpurpose>purge monitoring history</refpurpose>
12  </refnamediv>
13
14  <refsect1>
15    <title>Description</title>
16    <para>
17      Purges monitoring history from the <literal>repmgr.monitoring_history</literal> table to
18      prevent excessive table growth.
19    </para>
20    <para>
21      By default <emphasis>all</emphasis> data will be removed; Use the <option>-k/--keep-history</option>
22      option to specify the number of days of monitoring history to retain.
23    </para>
24    <para>
25      This command can be executed manually or as a cronjob.
26    </para>
27  </refsect1>
28
29  <refsect1>
30    <title>Usage</title>
31    <para>
32      This command requires a valid <filename>repmgr.conf</filename> file for the node on which it is
33      executed; no additional arguments are required.
34    </para>
35  </refsect1>
36
37  <refsect1>
38    <title>Notes</title>
39
40    <para>
41      Monitoring history will only be written if &repmgrd; is active, and
42      <varname>monitoring_history</varname> is set to <literal>true</literal> in
43      <filename>repmgr.conf</filename>.
44    </para>
45  </refsect1>
46
47  <refsect1 id="repmgr-cluster-cleanup-events">
48    <title>Event notifications</title>
49    <para>
50      A <literal>cluster_cleanup</literal> <link linkend="event-notifications">event notification</link> will be generated.
51    </para>
52  </refsect1>
53
54  <refsect1>
55    <title>Options</title>
56    <variablelist>
57
58      <varlistentry>
59        <term><option>--node-id</option></term>
60        <listitem>
61          <para>
62            Only delete monitoring records for the specified node.
63          </para>
64        </listitem>
65      </varlistentry>
66    </variablelist>
67  </refsect1>
68
69  <refsect1>
70    <title>See also</title>
71    <para>
72      For more details see the sections <xref linkend="repmgrd-monitoring"/> and
73      <xref linkend="repmgrd-monitoring-configuration"/>.
74    </para>
75  </refsect1>
76
77</refentry>
78