SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Problem with Maintenance Plan Cleanup Task


Problem with Maintenance Plan Cleanup Task

Author
Message
Chris Stride
Chris Stride
SSChasing Mays
SSChasing Mays (640 reputation)SSChasing Mays (640 reputation)SSChasing Mays (640 reputation)SSChasing Mays (640 reputation)SSChasing Mays (640 reputation)SSChasing Mays (640 reputation)SSChasing Mays (640 reputation)SSChasing Mays (640 reputation)

Group: General Forum Members
Points: 640 Visits: 230
Hi,

Sorry if this has been covered in other posts (I have been looking around) and I just haven't spotted the answer. I am having a problem using the Maintenance Plan Cleanup Task in SQL Server 2005 to delete backup files older than a certain number of hours.

I have backup files (all with a .BAK extension) residing on a separate disk (and logical drive) of a server. When the backups are performed, they go into folders on the root of this drive with names corresponding to the name of the database being backed up.

While we want to retain the most recent backups on the server for ease of restoration, they are fairly big files (even using a 3rd party compression tool), so I need to remove those older than a few hours for the next backups to be able to fit onto the disk.

After experiencing the problem of the plan executing without error, but not actually deleting the relevant files, I read that there was a problem with this with the initial release of SP2. I was on this version, so implemented CU7 to take the build to 9.00.3239.00. I have verified this version by running select @@version. The server was re-booted after applying CU7.

Prior to implementing CU7, I deleted the Maintenance Plan that contained the Cleanup Task that wasn't working. After implementing CU7 (and re-booting) I then created a new plan with just this Cleanup Task and set it to delete files on the F drive, with the 'Include first-level subfolders' checked, the folder set to the relevant logical drive and file extension set to 'BAK'. The file age was set to delete files older than 20 hours and the 'Delete files of the following type' is set to Backup Files.

The new plan executes without error, but the .BAK files older than 20 hours from job run time are still there. Does anyone have any ideas as to what I can check? or what I'm doing wrong?

I don't think there are any folder permission issues at play here (I even temporarily gave 'Everyone' full control!), so am a bit stuck. I really don;t want to run a VB or whatever script to do this as I need things to be (very) easily supportable in my absence.

Thanks in advance for any help,
Chris
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum







































































































































































SQLServerCentral


Search