Maintenance Cleanup Task(s) running 'successfully' but not deleting back up files
I have a maintenance plan setup for all my user databases on a particular server, which does all the usually things at various intervals.
The 7th and final subplan is a two stage cleanup plan; firstly old full backups are deleted, then old transaction log backups are deleted. These tasks appear to run successfully - the subplan's job history reports that the plan was run on time, and runs xp_delete_file twice - but clearly files are not deleted.
The task settings are:
- Backup Files
- Search folder and delete based on extension - .bak
- Include subfolders
- Delete files older than 2 weeks
and
- Backup Files
- Search folder and delete based on extension - .trn
- Include subfolders
- Delete files older than 5 days
Any ideas?
Solution 1:
And of course, as soon as I post I figure out the answer...
There a number of people suffering similar problems (2005 as well) and solutions range from scripts to SPs and to hotfixes.
Mine was much simpler - I'd specified '.BAK' as the extension, rather than 'BAK'!
It's a bit of a 'Doh!' moments, but nevertheless, I'd have hoped that the GUI would have either handled the situation or at least complained to me about the problem.
Anyway, problem solved...