Search Postgresql Archives

Re: Restarting DB after moving to another drive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux