Raghavendra Rao J S V wrote:
> Thank you very much for your explanation.
>
> We are taking the backup of database everyday using pg_basebackup utility. We
> have implemented a pg_basebackup utility through shell script.This will be
> invoked everyday at 2AM and takes the backup of database.
This is a bad idea. If you don't have a very firm grasp of how to write
a backup system, it's better not to write it yourself, because there are
many possible errors you can make that can lead you to end up with
backups that look ok but are actually invalid.
I suggest you use a battle-tested tool such as https://pgbarman.org/ to
do the backups for you. It comes with instructions about what to use in
archive_command, how to take base backups, simple mechanism to remove
old backups, easy to use restore operations, etc.
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services