How to purge old files from pg_xlogs directoryHow to clear pg_xlog directory?Postgres synchronized backup -...

What exploit are these user agents trying to use?

Is the Joker left-handed?

How to take photos in burst mode, without vibration?

I'm flying to France today and my passport expires in less than 2 months

A reference to a well-known characterization of scattered compact spaces

What is the word for reserving something for yourself before others do?

Should I tell management that I intend to leave due to bad software development practices?

Today is the Center

Is it possible to download Internet Explorer on my Mac running OS X El Capitan?

What killed these X2 caps?

Theorems that impeded progress

Brothers & sisters

What is the PIE reconstruction for word-initial alpha with rough breathing?

Watching something be written to a file live with tail

Is it canonical bit space?

What's the point of deactivating Num Lock on login screens?

Is "remove commented out code" correct English?

How to model explosives?

How much of data wrangling is a data scientist's job?

Is it possible to create light that imparts a greater proportion of its energy as momentum rather than heat?

Why is the 'in' operator throwing an error with a string literal instead of logging false?

Took a trip to a parallel universe, need help deciphering

How can I make my BBEG immortal short of making them a Lich or Vampire?

Stopping power of mountain vs road bike



How to purge old files from pg_xlogs directory


How to clear pg_xlog directory?Postgres synchronized backup - what's with the archive?How can I request a flush of the postgresql transaction logs?Strategy for multiple distinct databases in PostgreSQLpg_hba.conf and postgresql.conf in old installation directoryHow to change the Write Ahead Log directoryHow can we execute a log file from pg_xlogs directory postgresql?Error Receiving WAL files with barmanHow to change the Write Ahead Log directory on WindowsWhy PostgreSQL remove or add WAL files?postgresql configuring wal_archive directory






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















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?










share|improve this question
















bumped to the homepage by Community 5 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.






















    0















    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?










    share|improve this question
















    bumped to the homepage by Community 5 mins ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      0












      0








      0








      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?










      share|improve this question
















      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?







      postgresql write-ahead-logging






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Feb 10 '18 at 23:22







      TSG

















      asked Feb 10 '18 at 23:15









      TSGTSG

      1385




      1385





      bumped to the homepage by Community 5 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 5 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          1 Answer
          1






          active

          oldest

          votes


















          0














          Firstly PG 8.4 is no longer supported (since July 2014), you should move your databases to a supported version as soon as possible.



          The WAL configuration settings for the 8.4 version are documented here:



          https://www.postgresql.org/docs/8.4/static/runtime-config-wal.html



          In particular checkpoint_segments control the number of WAL files.



          You must not delete WAL files, either manually or with a cron job or with archive_command. This would definitely corrupt your database.



          WAL files may grow in number if archive_command is not working or lagging behind.






          share|improve this answer
























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "182"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f197586%2fhow-to-purge-old-files-from-pg-xlogs-directory%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            Firstly PG 8.4 is no longer supported (since July 2014), you should move your databases to a supported version as soon as possible.



            The WAL configuration settings for the 8.4 version are documented here:



            https://www.postgresql.org/docs/8.4/static/runtime-config-wal.html



            In particular checkpoint_segments control the number of WAL files.



            You must not delete WAL files, either manually or with a cron job or with archive_command. This would definitely corrupt your database.



            WAL files may grow in number if archive_command is not working or lagging behind.






            share|improve this answer




























              0














              Firstly PG 8.4 is no longer supported (since July 2014), you should move your databases to a supported version as soon as possible.



              The WAL configuration settings for the 8.4 version are documented here:



              https://www.postgresql.org/docs/8.4/static/runtime-config-wal.html



              In particular checkpoint_segments control the number of WAL files.



              You must not delete WAL files, either manually or with a cron job or with archive_command. This would definitely corrupt your database.



              WAL files may grow in number if archive_command is not working or lagging behind.






              share|improve this answer


























                0












                0








                0







                Firstly PG 8.4 is no longer supported (since July 2014), you should move your databases to a supported version as soon as possible.



                The WAL configuration settings for the 8.4 version are documented here:



                https://www.postgresql.org/docs/8.4/static/runtime-config-wal.html



                In particular checkpoint_segments control the number of WAL files.



                You must not delete WAL files, either manually or with a cron job or with archive_command. This would definitely corrupt your database.



                WAL files may grow in number if archive_command is not working or lagging behind.






                share|improve this answer













                Firstly PG 8.4 is no longer supported (since July 2014), you should move your databases to a supported version as soon as possible.



                The WAL configuration settings for the 8.4 version are documented here:



                https://www.postgresql.org/docs/8.4/static/runtime-config-wal.html



                In particular checkpoint_segments control the number of WAL files.



                You must not delete WAL files, either manually or with a cron job or with archive_command. This would definitely corrupt your database.



                WAL files may grow in number if archive_command is not working or lagging behind.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Feb 12 '18 at 11:38









                Daniel VéritéDaniel Vérité

                17.9k33653




                17.9k33653






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Database Administrators Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f197586%2fhow-to-purge-old-files-from-pg-xlogs-directory%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    ORA-01691 (unable to extend lob segment) even though my tablespace has AUTOEXTEND onORA-01692: unable to...

                    Always On Availability groups resolving state after failover - Remote harden of transaction...

                    Circunscripción electoral de Guipúzcoa Referencias Menú de navegaciónLas claves del sistema electoral en...