I\'m trying to create a cronjob to back up my database every night before something catastrophic happens. It looks like this command should meet my needs:
0
This one liner helps me while creating dump of a single database.
PGPASSWORD="yourpassword" pg_dump -U postgres -h localhost mydb > mydb.pgsql