Re: [GENERAL] Using cp to back up a database?

Поиск
Список
Период
Сортировка
От Stephen Frost
Тема Re: [GENERAL] Using cp to back up a database?
Дата
Msg-id 20171010130848.GU4628@tamriel.snowman.net
обсуждение исходный текст
Ответ на Re: [GENERAL] Using cp to back up a database?  (Ron Johnson <ron.l.johnson@cox.net>)
Список pgsql-general
Ron,

* Ron Johnson (ron.l.johnson@cox.net) wrote:
> Maybe my original question wasn't clear, so I'll try again: is it
> safe to do a physical using cp (as opposed to rsync)?

Frankly, I'd say no.  There's nothing to guarantee that the backup is
actually sync'd out to disk.  Further, you're probably in the same boat
when it comes to WAL archiving (just using 'cp' there isn't good for the
same reason), though that's arguably worse because once you return true
from archive_command, that WAL file will be gone and you could end up
with a hole in your WAL stream.

Next, this backup method has been deprecated because of issues with the
backup_label file and what happens when the system crashes during a
backup.

So, no, you shouldn't be just using 'cp', or 'rsync', or any of those
similar, simple, tools for doing a proper PG backup.  Use a tool which
has been developed specifically for PG such as pgBackRest, barman,
WAL-E, WAL-G, etc.

Thanks!

Stephen

В списке pgsql-general по дате отправления:

Предыдущее
От: Olivani Prisila
Дата:
Сообщение: [GENERAL] [asking about how to upgrade docker postgresql without losing the data]
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: [GENERAL] pg_start/stop_backup naming conventions