0 like 0 dislike
30 views

Please log in or register to answer this question.

1 Answer

0 like 0 dislike
answered by (13.2k points)  

Below shell script will be helpfull to start the postgres DB if service is down

port=`netstat  -tunlp   | grep :5432 | awk '{print $4}' | awk -F ':' '{print  $NF }'`
k=5432
if [[ $port  -ne  $k  ]]
then
  `/nijam/9.6.15/bin/postgres -D  /cal/data`     &> /dev/null

fi

 

Related questions

0 like 0 dislike
2 answers
Welcome to PostgreSQL Database Discussion Forum where you can ask questions and receive answers from other members of the community. Can discuss here Oracle, Postgresql, mariadb , mySQL , AWS , Linux , MSSQL , MongoDB , Greenplum databases related queries ...etc.
...