Help! Runaway archive/ directory in Postgresql 10

Why is my archive/ directory on my Centos 7 Postgresql 10.4 installation several hundred GibiBytes?

### Here is what the Archiving section of the postgresql.conf file looks like by default:# - Archiving -archive_mode = on              # enables archiving; off, on, or always
# (change requires restart)
archive_command = 'cp %p /var/lib/pgsql/10/archive/%f' # command to use to archive a logfile segment
# - Archiving -archive_mode = off              # enables archiving; off, on, or always
# (change requires restart)
### archive_command = 'cp %p /var/lib/pgsql/10/archive/%f' # command to use to archive a logfile segment
# service postgresql-10 restart
-- then go ahead and check the status
# systemctl status postgresql-10.service
[root@aserver1 ~]# su - postgres
Last login: Fri Aug 31 23:47:52 EDT 2018 on pts/1
-bash-4.2$ psql -c "select application_name, state, sync_priority, sync_state from pg_stat_replication;"
application_name | state | sync_priority | sync_state
------------------+-----------+---------------+------------
pgslave01 | streaming | 1 | sync
(1 row)
-bash-4.2$

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store