Backups are recommended

My CNPG cluster for Nextcloud broke and WAL was written and not deleted, when the cluster returned to a synced state.

pg_controldata -D /var/lib/postgresql/data/pgdata/ > /var/lib/postgresql/data/pgwalfile.txt
pg_archivecleanup -d /var/lib/postgresql/wal/pg_wal/ $(cat /var/lib/postgresql/data/pgwalfile.txt| grep "Latest checkpoint's REDO WAL file" | awk '{print $6}')

This gets the current checkpoint and cleans up dangling WAL files without breaking the database.