Home All Groups Group Topic Archive Search About

Maintenence Cleanup Task does not delete backup files



Author
2 Dec 2008 7:42 PM
mat
I'm testing a new Mainentence Cleanup Task that runs inside the same
subprocess as the backup task. I have it set up to delete .bak files in
the backup dir that are older than 1 hour (for testing). When I run the
task, the backup runs successfully but no older backups are ever
deleted. Can anyone offer a suggestion as to why?

The cleanup task is enabled; it's looking in the correct dir for .bak
files; it's looking for backup files not text reports. I just can't see
what the issue might be. There are no errors reported when I execute the
task.

Author
3 Dec 2008 4:44 AM
Jonathan Kehayias
Make sure that you have a \ at the end of the path, so if the backups are in
D:\SQLBackups use D:\SQLBackups\
Also make sure that the extension is bak and not .bak  For whatever reason
it doesn't like having the . before the bak.
If you are deleting trn files and bak files, have two separate jobs one to
cleanup the bak files and one to clean up the trn files.
If you backed up databases to separate folders, checking the 'Include
first-level subfolders' check box is necessary.

Also make sure that the return of SELECT @@Version is 9.0.3050 or greater.
If it isn't download Service Pack 2 and apply it to your SQL Server as there
were fixes made to Maintenance Plans in SP1 and SP2.
--
Jonathan Kehayias
SQL Server MVP
http://jmkehayias.blogspot.com
http://www.sqlclr.net


Show quoteHide quote
"mat" <m**@notarealdotcom.adr> wrote in message
news:MPG.239f2f6ea41a002498973d@msnews.microsoft.com...
> I'm testing a new Mainentence Cleanup Task that runs inside the same
> subprocess as the backup task. I have it set up to delete .bak files in
> the backup dir that are older than 1 hour (for testing). When I run the
> task, the backup runs successfully but no older backups are ever
> deleted. Can anyone offer a suggestion as to why?
>
> The cleanup task is enabled; it's looking in the correct dir for .bak
> files; it's looking for backup files not text reports. I just can't see
> what the issue might be. There are no errors reported when I execute the
> task.
Are all your drivers up to date? click for free checkup

Author
3 Dec 2008 3:36 PM
mat
In article <#PUSKHQVJHA.3***@TK2MSFTNGP06.phx.gbl>,
jmkehayias.nospam@nospam.google.com says...
> Make sure that you have a \ at the end of the path, so if the backups are in
> D:\SQLBackups use D:\SQLBackups\
> Also make sure that the extension is bak and not .bak  For whatever reason
> it doesn't like having the . before the bak.
> If you are deleting trn files and bak files, have two separate jobs one to
> cleanup the bak files and one to clean up the trn files.
> If you backed up databases to separate folders, checking the 'Include
> first-level subfolders' check box is necessary.
>
> Also make sure that the return of SELECT @@Version is 9.0.3050 or greater.
> If it isn't download Service Pack 2 and apply it to your SQL Server as there
> were fixes made to Maintenance Plans in SP1 and SP2.
>
Thank you so much...in my case changing the file extension was enough to
make it work.

Bookmark and Share