Re: Restarting DB after moving to another drive

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Restarting DB after moving to another drive
Date: 2015-05-15 09:52:23
Message-ID: 5555C1D7.5070301@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Giuseppe Broccolo 2015-05-15 09:58:59 Re: template_postgis issue
Previous Message Sachin Srivastava 2015-05-15 09:35:27 template_postgis issue