Sample Header Ad - 728x90

How to purge old files from pg_xlogs directory

1 vote
1 answer
772 views
I have an archive command copying WAL files from pg_xlogs to my archive directory. However, I notice that the pg_xlogs directory is growing in size with (but is limiting itself to around 7 files). What controls this "7" value? Is there a risk it will grow to a huge number of files? How do I limit the number of log files, or even better, limit to no more than 48 hours worth? I found a similarly titled question here but it doesn't really apply. I'm using PostgreSQL version 8.4.20 (so settings/commands from v9 won't apply) Can I just create a cron job that deletes files from pg_xlogs older than 48 hours? Will this crash/corrupt the pgsql server? Is there a better way? Can I use my archive_command to delete the source file after moving to my archive directory?
Asked by TSG (193 rep)
Feb 10, 2018, 11:15 PM
Last activity: Oct 13, 2024, 08:07 PM