Re: Restarting DB after moving to another drive - Mailing list pgsql-general

From John R Pierce
Subject Re: Restarting DB after moving to another drive
Date
Msg-id 5555C1D7.5070301@hogranch.com
Whole thread Raw
In response to Re: Restarting DB after moving to another drive  (Francisco Olarte <folarte@peoplecall.com>)
List pgsql-general
I use this script, run nightly via crontab, on my small pgsql servers.
it runs as the postgres user.

#!/bin/bash
/usr/pgsql-9.3/bin/pg_dumpall --globals-only | gzip >
/home2/backups/pgsql/pgdumpall.globals.`date +\%a`.sql.gz
for db in $(psql -tc "select datname from pg_database where not
datistemplate"); do   \
                                 pg_dump -Fc -f
/home2/backups/pgsql/pgdump.$i.$(date +\%a).dump $db
         done


this creates a globals-only backup and a seperate backup of each
database, for each day of the week.



--
john r pierce, recycling bits in santa cruz



pgsql-general by date:

Previous
From: Sachin Srivastava
Date:
Subject: template_postgis issue
Next
From: Giuseppe Broccolo
Date:
Subject: Re: template_postgis issue