Created
September 30, 2015 18:43
-
-
Save mchristopher/87a4bb13f61e6bd1a196 to your computer and use it in GitHub Desktop.
postgresql replication script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage in postgresql.conf: | |
# archive_command = '/path/to/script.sh %p %f' | |
# Close out on error | |
set -e | |
wal_path=$1 | |
wal_filename=$2 | |
# Send to servers | |
rsync -a $wal_path postgresql@1.2.3.4:/var/lib/pgsql/data/archive/$wal_filename | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment