OLA Backup job not deleting old Transaction Log Backups

Recently I encountered one issue where OLA Hallengren transaction log backup job was not deleting old backup files for one particular user database. While for other databases it was deleting the files as per retention period mentioned against “CleanupTime” parameter.

“CleanupTime” parameter was mentioned as 48 hours but there were log backup files older than one month residing on disk. There was no error related to deleting the files. Observed in output xp_delete_file was also having cutoff date mentioned as one month old.

Upon checking the documentation https://ola.hallengren.com/sql-server-backup.html , came to know that DatabaseBackup has a check to verify that transaction log backups that are newer than the most recent full or differential backup are not deleted.

As full backup for affected database one month old, it was not deleting any transaction log backup file older than backup start time of full backup.

Hope this information helps you!
Happy learning!!