Created
January 21, 2013 19:16
-
-
Save amccloud/4588476 to your computer and use it in GitHub Desktop.
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
# slave 10.0.1.3 | |
sudo /etc/init.d/postgresql stop | |
sudo bash -c "rm -r /var/lib/postgresql/9.1/main/pg_xlog/*" | |
# master 10.0.1.2 | |
sudo su - postgres | |
psql -c ";SELECT pg_start_backup('backup', true)"; | |
rsync -av --rsync-path "sudo rsync" --exclude postmaster.pid --exclude pg_xlog /var/lib/postgresql/9.1/main/ [email protected]:/var/lib/postgresql/9.1/main/ | |
psql -c ";SELECT pg_stop_backup()"; | |
# slave 10.0.1.3 | |
sudo /etc/init.d/postgresql start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment