Archive logging not cleaning up pg_wal directory
От | Justin Swanhart |
---|---|
Тема | Archive logging not cleaning up pg_wal directory |
Дата | |
Msg-id | CAJM9iN3w3UdA3q4_Xnw+Pg+Nnxe4OAUjLQ7EgLtPe36y4A0HDA@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: Archive logging not cleaning up pg_wal directory
Re: Archive logging not cleaning up pg_wal directory |
Список | pgsql-general |
Hi,
I have the following in my postgresql.conf for archive logging:
archive_command='test ! -f /var/lib/postgresql/prod_archive_logs/%f && cp %p /var/lib/postgresql/prod_archive_logs/%f'
archive_command='test ! -f /var/lib/postgresql/prod_archive_logs/%f && cp %p /var/lib/postgresql/prod_archive_logs/%f'
This command is properly copying the log files to my archive directory but they remain in the `pg_wal` directory after they are copied, consuming hundreds of gigs of space. Am I supposed to create a cron job to clean out the `pg_wal` directory periodically (keep only 1 day of logs I guess?)
I tried to use mv:
archive_command='test ! -f /var/lib/postgresql/prod_archive_logs/%f && mv %p /var/lib/postgresql/prod_archive_logs/%f'
archive_command='test ! -f /var/lib/postgresql/prod_archive_logs/%f && mv %p /var/lib/postgresql/prod_archive_logs/%f'
When I did this the archives were moved away to the archive directory but when I tried to set up replication the server could not find the archived log to replicate from so I changed it to "cp" and now have this problem.
What am I missing?
Regards,
--Justin
В списке pgsql-general по дате отправления: