Using cp to back up a database?

From: Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Using cp to back up a database?
Date: 2017-10-09 13:40:46
Message-ID: 356ee3ba-e1b6-d0e5-0ae6-1e66a6df3252@cox.net
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

v8.4.20

This is what the current backup script uses:

/usr/bin/psql -U postgres -c "SELECT pg_start_backup('Incrementalbackup',true);"
cp -r /var/lib/pgsql/data/* $dumpdir/data/
/usr/bin/psql -U postgres template1 -c "SELECT pg_stop_backup();"

Should it use rsync or pg_dump instead?

Thanks

--
World Peace Through Nuclear Pacification

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2017-10-09 13:51:32 Re: Equivalence Classes when using IN
Previous Message Durumdara 2017-10-09 11:12:29 Error: "cached plan must not change result type"