Skip to main content
added 20 characters in body
Source Link
pappu_kutty
  • 2.5k
  • 8
  • 58
  • 99

i would like to take backup and restore of my postgresql database automatically.

  1. take backup automatically from postgresql with cron trigger in windows pc
  2. later i will do restore when ever it required.

i have below bat commands to take back up of my database

F:
cd F:\softwares\postgresql-12.1-3-windows-x64-binaries\pgsql\bin
pg_dump.exe -U postgres -W postgres -s fuelman > E:\fuel_man_prod_backup\prod.sql
cmd /k

but i am getting

pg_dump: error: too many command-line arguments (first is "-s")

also i need to take both schema structure with data.

Edit :- removed password -W

i would like to take backup and restore of my postgresql database automatically.

  1. take backup automatically from postgresql with cron trigger in windows pc
  2. later i will do restore when ever it required.

i have below bat commands to take back up of my database

F:
cd F:\softwares\postgresql-12.1-3-windows-x64-binaries\pgsql\bin
pg_dump.exe -U postgres -W postgres -s fuelman > E:\fuel_man_prod_backup\prod.sql
cmd /k

but i am getting

pg_dump: error: too many command-line arguments (first is "-s")

also i need to take both schema structure with data.

i would like to take backup and restore of my postgresql database automatically.

  1. take backup automatically from postgresql with cron trigger in windows pc
  2. later i will do restore when ever it required.

i have below bat commands to take back up of my database

F:
cd F:\softwares\postgresql-12.1-3-windows-x64-binaries\pgsql\bin
pg_dump.exe -U postgres -s fuelman > E:\fuel_man_prod_backup\prod.sql
cmd /k

but i am getting

pg_dump: error: too many command-line arguments (first is "-s")

also i need to take both schema structure with data.

Edit :- removed password -W

Source Link
pappu_kutty
  • 2.5k
  • 8
  • 58
  • 99

postgresql db take backup and restore with data

i would like to take backup and restore of my postgresql database automatically.

  1. take backup automatically from postgresql with cron trigger in windows pc
  2. later i will do restore when ever it required.

i have below bat commands to take back up of my database

F:
cd F:\softwares\postgresql-12.1-3-windows-x64-binaries\pgsql\bin
pg_dump.exe -U postgres -W postgres -s fuelman > E:\fuel_man_prod_backup\prod.sql
cmd /k

but i am getting

pg_dump: error: too many command-line arguments (first is "-s")

also i need to take both schema structure with data.