Difference between revisions of "Postgres Backup & Restore"
Jump to navigation
Jump to search
(Created page with "nohup pg_dump -Fc $DB > $DB-$(date +%d-%m-%y_%H-%M).pgdumpFc pg_restore") |
|||
Line 1: | Line 1: | ||
+ | .env | ||
+ | ``` | ||
+ | export PGPASSWORD=mypass | ||
+ | export PGUSER=admin | ||
+ | export PGDATABASE=mydb | ||
+ | export PGHOST=myhostorip | ||
+ | ``` | ||
+ | |||
+ | ``` | ||
nohup pg_dump -Fc $DB > $DB-$(date +%d-%m-%y_%H-%M).pgdumpFc | nohup pg_dump -Fc $DB > $DB-$(date +%d-%m-%y_%H-%M).pgdumpFc | ||
pg_restore | pg_restore | ||
+ | ``` |
Revision as of 20:11, 9 April 2022
.env
export PGPASSWORD=mypass export PGUSER=admin export PGDATABASE=mydb export PGHOST=myhostorip
nohup pg_dump -Fc $DB > $DB-$(date +%d-%m-%y_%H-%M).pgdumpFc pg_restore