Postgresql recovery.conf

From NailingJello.com
Jump to: navigation, search

I have two ready recovery.conf files

standby recovery.conf

Saved as ~postgres/scripts/recovery.conf. It is what is normally running on the standby server to put it in a continuous recovery mode. Touch /postgres/omnipitr/finish.recovery file to take the server out of standby.

standby_mode = 'on'
restore_command = ' /usr/local/bin/omnipitr-restore -l /var/log/postgresql/omnipitr-^Y^m^d.log -s gzip=/postgres/WAL -f /postgres/omnipitr/finish.recovery  -p /postgres/omnipitr/pause.removal -v -t /tmp/omnipitr/ -w 3600 -pp /usr/lib/postgresql/9.0/bin/pg_controldata %f %p'
trigger_file = '/postgres/omnipitr/finish.recovery' 

recovery_pitr.conf

Point in time recovery template. Used when we need to clone the production to UAT or test. Most often use is to recover user's data (clone from a given time onto UAT or test, recover user data and put it back on production).

# Use this file for Point in time recovery of the database

recovery_target_time = '2011-08-14 22:39:00 EST' # CHANGE ME

restore_command = ' /usr/local/bin/omnipitr-restore -l /var/log/postgresql/omnipitr-^Y^m^d.log -s gzip=/postgres/WAL -f /postgres/omnipitr/finish.recovery  -p /postgres/omnipitr/pause.removal -v -t /tmp/omnipitr/ -w 3600 -pp /usr/lib/postgresql/9.0/bin/pg_controldata %f %p'
trigger_file = '/postgres/omnipitr/finish.recovery'