pgbackrest generates the backup folder as well as it’s related archived WAL segments and both are required to ensure proper restore in future. It’s always best to copy these folders on a different machine for future usage.
pgbackrest info command along with little modification in this script can be used to detect the name of the current backup folder and automate the process of copying it to the remote machine. .
But to locate the related archived WAL segment files may be little tedious as the names are referred as start and stop segment in /var/lib/pgbackrest/backup/bahmni-postgres/backup folder name/backup.manifest file.
So to ensure completeness of backup without the archive folder pgbackrest provides an option of –archive-copy ( though the documentation calls it “slightly paranoid option”) it makes copying the current folder to remote machine lot easier.
For the full backup this option can be used by modifying this file and same way for this code for the incremental backup.
Should future bahmni versions make this option default?