Optimizing PostgreSQL Log Backups

The Archive log directory is configured with archive_command parameter and set to a local location on client to perform log backups. For more information, refer Configuring the PostgreSQL Archive Log Directory.

Commvault recommends to schedule several log only backups between full backups. To create automatic schedule, see Creating an Automatic Schedule for Database Log Backups.

To delete the transaction log files, see Enabling PostgreSQL Archive Log Deletion after Backup. If Archive Delete check box is not selected, the Commvault software does not prune the logs.

For a PostgreSQL instance on Linux client with large data, if the backup of data and tablespace directories take long time to complete, the archived logs may fill up the volume hosting the archive log directory. To facilitate log backup while data backup is in progress and perform log backup at a greater frequency, you can use disk caching of log backups.

When this feature is enabled, archive_command is set in the postgresql.auto.conf file to copy the logs to library location in the MediaAgent associated with the instance. To append to the archive_command, instead of overwriting the existing command, set the bPreserveArchiveCommandWithDumpSweep additional setting under PostgreSQL to true. When a log is archived, it will write the log file directly to MediaAgent. It avoids delay in backup and no space is consumed to back up the logs. For more information, see Disk Caching for Frequent Log Backups.

However, during restore, the required logs need to be staged in the destination instance based on the restore time selected. The archive log directory configured in the instance properties will be used to set the restore_command.

Note

When disk caching feature is enabled for the instance, the on-demand and log-only backups will not be allowed because performing a log backup explicitly is not required.

When the feature is disabled, the archive_command entry from postgresql.auto.conf is also removed.

Loading...