Friday, June 10, 2016

Backup and Restore with PostgreSQL


Enter psql
DOS> psql -U user database_name
DOS> psql database_name (if no password defined)

Drop DB
DOS> dropdb database_name
PSQL# drop database database_name

Create DB
DOS> createdb database_name
PSQL# create database database_name

Dump DB
DOS> pg_dump database_name > file_name

Restore from Dump
DOS> psql -U user -d database_name -f file_name


Sync multiple git repo at once

Use the following command in Linux will do the job:  ls -d RepoNames* | xargs -I{} git -C {} pull