Last active
June 17, 2020 13:19
-
-
Save andrewp-as-is/ebce68416d4d1e3fa358237eea36215c to your computer and use it in GitHub Desktop.
PostgreSQL ssh
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
SSH_HOSTNAME:=ubuntu@github42 | |
NAME:=github42 | |
VERSION:=12 | |
all: | |
make sync | |
make restart | |
make status | |
sync: | |
scp pg_hba.conf $(SSH_HOSTNAME):/tmp/pg_hba.conf | |
scp postgresql.conf $(SSH_HOSTNAME):/tmp/postgresql.conf | |
ssh $(SSH_HOSTNAME) sudo cp /tmp/pg_hba.conf /etc/postgresql/$(VERSION)/$(NAME)/pg_hba.conf | |
ssh $(SSH_HOSTNAME) sudo cp /tmp/postgresql.conf /etc/postgresql/$(VERSION)/$(NAME)/postgresql.conf | |
restart: | |
ssh $(SSH_HOSTNAME) sudo systemctl restart postgresql.service # sudo systemctl stop postgresql.service | |
status: | |
ssh $(SSH_HOSTNAME) 'service postgresql status | tee';: | |
ssh $(SSH_HOSTNAME) 'ps -ax | grep -v grep | grep postgres';: | |
ssh $(SSH_HOSTNAME) 'sudo netstat -tulpn | grep :5433';: | |
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
sudo systemctl restart postgresql.service | |
service postgresql status | tee | |
ps -ax | grep -v grep | grep postgres | |
sudo netstat -tulpn | grep :543 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment