The following code needs to be inserted in the Transaction Log Backup routine just before the check to see if bolProcessDB is true (indicating we're going to add the steps to backup the transaction log for the current database):
' Log Shipping generates its own set of transaction log backups, and doing log backups
' outside of that process would break the chain of log backup files used by the remote
' databases, so we do NOT want to backup transaction logs for databases that are using
' log shipping.
If bolProcessDB = True Then
Dim jobLogShipBackup As Job
jobLogShipBackup = srvMgmtServer.JobServer.Jobs("LSBackup_" & dbDatabase.Name)
If Not jobLogShipBackup Is Nothing Then ' A Log Ship backup job exists for this database
bolProcessDB = False ' so do not include it in the transaction log backup
End If
End If
With this code, the database won't be processed, so there's no break in the log backup chain for log shipping.
Allen