May 6, 2010 at 11:12 am
Hi all,
I'm having a problem with a maintenance plan I created and wonder if anyone could help out.
I have a program that automatically exports a backup of some configurations and outputs them in a xml file. I tried to setup a maintenance plan to automatically delete any xml files older than a certain age, but that didn't work. I then had the export output in the .bak format, but the maintenance plan still didn't work.
I then created a database backup to the exact same directory and the maintenance plan removed the .bak files that SQL created, but not the ones I created.
Can SQL only delete files that it created? If so, is there a way around this?
Thanks for the help.
May 6, 2010 at 2:11 pm
Yes - the utilities in SQL Server to remove backup files will only remove actual SQL Server created files. You could try setting up the job to remove text files (report files) and see if that works - but I don't think it will.
Your best alternative is to move outside SQL Server and use a scripting language to delete the files. Powershell is real simple to use for this, as well as VBScript and other scripting languages.
Jeffrey Williams
“We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”
― Charles R. Swindoll
How to post questions to get better answers faster
Managing Transaction Logs
May 7, 2010 at 12:04 pm
Jeffrey Williams-493691 (5/6/2010)
Yes - the utilities in SQL Server to remove backup files will only remove actual SQL Server created files. You could try setting up the job to remove text files (report files) and see if that works - but I don't think it will.Your best alternative is to move outside SQL Server and use a scripting language to delete the files. Powershell is real simple to use for this, as well as VBScript and other scripting languages.
Thanks for the info. I took your advice, kind of.
I still wanted the logging from SQL and the ability to send an email if the cleanup job fails so I created a new job that runs a CMD line script and I have a maintenance plan that calls this job. So far it's working great!
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply