OmniPITR - omnipitr-cleanup
/some/path/omnipitr/bin/omnipitr-cleanup [options] %r
- --archive (-a)
Where archived wal segments are kept.
Check "Archive specification" for more details.
- --log (-l)
Name of logfile (actually template, as it supports %% strftime(3) markers. Unfortunately due to the %x usage by PostgreSQL, We cannot use %% macros directly. Instead - any occurence of ^ character in log dir will be first changed to %, and later on passed to strftime.
Please note that on some systems (Solaris for example) default shell treats ^ as special character, which requires you to quote the log filename (if it contains ^ character). So you'd better write it as:
Name of file to use for pidfile. If it is specified, than only one copy of omnipitr-cleanup (with this pidfile) can run at the same time.
Trying to run second copy of omnipitr-cleanup will result in an error.
- --verbose (-v)
Log verbosely what is happening.
- --removal-pause-trigger (-p)
Path to file, which, if exists, causes omnipitr-cleanup to not do any removal - for example when running omnipitr-backup-slave.
Call to omnipitr-cleanup should be in archive_cleanup_command variable in recovery.conf.
Which options should be given depends only on installation, but generally you will need:
And of course the %r at the end.
This script is used only in cases of streaming replication, as in case of wal-file based replication omnipitr-restore can remove obsolete wal files.
If the wal segments are compressed you have to prefix archive path with compression type followed by '=' sign.
Allowed compression types:
Used file extension is .gz
Used file extension is .bz2
Used file extension is .lzma
archive_cleanup_command='/.../omnipitr-cleanup -l /var/log/omnipitr/cleanup.log -a /mnt/wal_restore/ %r'
Minimal setup, for gzip-compressed archives:
archive_cleanup_command='/.../omnipitr-cleanup -l /var/log/omnipitr/cleanup.log -a gzip=/mnt/wal_restore/ %r'
The OmniPITR project is Copyright (c) 2009-2012 OmniTI. All rights reserved.