Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Problem with Maintenance Plan Cleanup Task Expand / Collapse
Author
Message
Posted Thursday, May 22, 2008 9:34 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, June 18, 2014 2:12 AM
Points: 23, Visits: 137
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
Post #505275
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse