I have a maintenance plan that runs one task, to backup a database. The "backup set will expire" setting is set to 4 days, yet it does not remove backups older then 4 days, it only removes backups older then 6 days. I've tried deleting the maintenance plan and associated jobs and recreating setting the "expire" days at 4 yet it keeps retaining the last 6 days of backups. Is the "Backup set will expire" setting for this maintenance plan stored in a table in MSDB?? I have looked for it yet cannot find it. Any suggestions on how to resolve this issue? Below is the t-sql for the plan. Thank you in advance for your assistance.
BACKUP DATABASE [Production] TO DISK = N'G:\DB-Backups\Production\Production_backup_2016_03_14_154014_1770759.bak' WITH RETAINDAYS = 4, NOFORMAT, NOINIT, NAME = N'Production_backup_2016_03_14_154014_1770759', SKIP, REWIND, NOUNLOAD, STATS = 10
declare @backupSetId as int
select @backupSetId = position from msdb..backupset where database_name=N'Production' and backup_set_id=(select max(backup_set_id) from msdb..backupset where database_name=N'Production' )
if @backupSetId is null begin raiserror(N'Verify failed. Backup information for database ''OnBase_Production'' not found.', 16, 1) end
RESTORE VERIFYONLY FROM DISK = N'G:\DB-Backups\Production\Production_backup_2016_03_14_154014_1770759.bak' WITH FILE = @backupSetId, NOUNLOAD, NOREWIND