Auto clean pg_xlog
<p>Does anyone know how to clean up pg_xlog in PostgreSQL 9.5 automatically?
Since I enabled replication disk has been filled up to 200G for 2 weeks. So I cleaned it manually with the following commands:</p>

<pre><code>sudo service portgesql stop
sudo /usr/lib/postgresql/9.5/bin/pg_controldata /var/lib/postgresql/9.5/main/ | grep Next | grep -v Multi
sudo -u postgres /usr/lib/postgresql/9.5/bin/pg_resetxlog -o 44842 -x 575323138 -f /var/lib/postgresql/9.5/main/
sudo service portgesql start
</code></pre>

<p>Of course I can automate it with bash script, but the problem here is that it is necessary to stop PotgreSQL. Is there any other ways to clean this without stopping PostgreSQL?</p>