The maintenance task backs up the db and deletes any backup files older than 7 days successfully. However it should also delete the Maintenance Plan text reports after 7 days and it doesn't. The report indicates all the tasks complete successfully.
I've tried running an SQL Query (generated from View T-SQL) seperately and even though the message generated indicates the Command completed Successfully, the older text files still remain. Any idea on what could be causing this?
The T-SQL command is
EXECUTE master.dbo.xp_delete_file 1,N'H:\DailyDBBackups',N'txt',N'2018-06-29T13:11:37',1
NOTE: In the Maintenance Cleanup Task for the Maintenance Plan text reports the file extension specified is txt and "include first-level subfolders" is ticked.
Any help with a solution to this would be greatly appreciated. I'm tearing my hair out!!!