Postgres database shutdown no restart

If Postgres goes in once a day, the port is not open. Is there a way to open it with a command? You have to delete the .idx/.data/postgres file and rebuild it to work again.