April 27, 2007 at 8:50 am
I created a Maintenance Plan to do a nightly full backup and set the backup set to expire after 2 days.
Weeks later, old backups are sitting on the hard drive in the installation directory and I have to manually delete them. Here is a screen shot of what the plan looks like
What am I doing wrong?
April 28, 2007 at 7:41 am
Hi Brent
Make sure that you have not include the “.” in the file extension. Also make sure that you select the correct folder and don’t use the “Include first-level subfolders” option, I have found that creating a separate cleanup task for each folder tends to work better.
If it still does not work try running a profiler trace to capture the actual command being executed when the job runs, this may give you a better idea of why the files are not being deleted.
Ps. What version and SP level of SQL are you using?
Regards
April 30, 2007 at 6:48 am
I'm using v 2005, SP2. And, why doesn't "Backup Set will expire after 2 days" mean "Backup set will expire after 2 days?" The screen shot shows there is no period before "bak".
April 30, 2007 at 7:23 am
The "Backup set will expire" option just indicates for how many days SQL will be prevented from overwriting the backup set.
Another thing you can try is to open up you maintenance plan, right-click on the maintenance cleanup task and click edit. Then click on the view T-SQL button. This will show you the actual T-SQL which will be executed, you can then past this into a query window and try to track down the problem.
PS. The screen shot image is not displaying for some reason?
April 30, 2007 at 8:10 am
Okay, I think that fixed it. I didn't realize that was a separate task.
July 4, 2008 at 1:12 am
Hi,
I dont have the option like"include first level folders", am using SQL 2005 with out SP.Will SP will fix it?
Regards,
Arun
March 23, 2009 at 12:26 pm
thanks for this~! been banging my head why my backups are not being deleted. I had the period in front of the files extension.
December 18, 2014 at 10:20 am
THANK YOU! I had a "." in my file extension that was preventing my backups from being deleted. THANKS!
Erin
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply