Skip to content

Instantly share code, notes, and snippets.

@macroramesh6
Created January 27, 2022 03:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save macroramesh6/c35897d8722c8ea874ec986419b16eb8 to your computer and use it in GitHub Desktop.
Save macroramesh6/c35897d8722c8ea874ec986419b16eb8 to your computer and use it in GitHub Desktop.
AG Batch.bat
:: copy pg_hba.conf to the E:/postgres location
:: this is to allow the postgres user to connect to the database
@echo off
:: XCOPY Docs https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/xcopy#syntax
XCOPY /F /Y /D "C:\Program Files\PostgreSQL\9.3\pg_hba.conf" "E:\postgres\pg_hba.conf"
:: Restart PostgresSQL server
@REM pg_ctl restart
@REM call
::net stop postgresql
::net start postgresql
:: run this on every hour
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment