December 16th, 2013 by depesz | Tags: , , , , , | 2 comments »
Did it help? If yes - maybe you can help me?

I just now committed new version of OmniPITR.

You can download it from:

The important change about 1.3.0 is that there is new tool – omnipitr-backup-cleanup. What is it for?

Normally, when you have walarchiving and backups, you end up with a directory with bunch (lots of?) wal files, and another directory, which contains backups themselves.

omnipitr-backup-cleanup is a tool that is meant to enforce retention rules. You decide how long you want to keep backup (7 days default), and it will remove all older ones.

This is simple, and can be achieved even with:

$ find /mnt/backups -type f -mtime +7 -delete

That's true. But omnipitr-backup-cleanup checks also what is the oldest xlog that is required to restore from all currently stored backups, and will remove all earlier xlogs, as they are useless.

This means couple of things:

  • you can have just one crontab that will clean both walarchive and backup directories
  • you will never have too many xlogs in archive. If the xlog is obsolete, if will be removed
  • you can now easily use –skip-xlogs with omnipitr-backup-{slave,master}, and you have the warranty that all necessary xlogs to restore from backup will be in walarchive
  1. 2 comments

  2. # misha
    Dec 17, 2013

    is it based on pg_archivecleanup ?
    where do you look for the last wal?
    is it friendly to backups from standby?

  3. Dec 17, 2013

    @Misha:
    no. pg_archivecleanup is for cleaning walarchive on slave – so it’s similar to omnipitr-cleanup. Omnipitr-backup-cleanup is meant to remove backups and shared/long-term wal archive.

Sorry, comments for this post are disabled.