Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Maintenance Cleanup Task issue

Author  Topic 

netjam
Starting Member

37 Posts

Posted - 2009-11-26 : 23:31:42
Hi,
Part of my Maintenace plan is to executing Maintenance Cleanup Task,
but I am having a strange issue when Maintenance Cleanup Task executed successfully, but it does not delete anything.
I specified file extension 'zip'

Maintenance Cleanup Task (SERVER\SQL2008)
Maintenance Cleanup on Local server connection
Cleanup Database Backup files
Age: Older than 1 Days
Task start: 2009-11-27T03:23:35.
Task end: 2009-11-27T03:23:35.
Success
Command:EXECUTE master.dbo.xp_delete_file 0,N''E:\MSSQL\Backup\Dabase_Backup'',N''zip'',N''2009-11-26T03:23:35'',1

I tried to execute it separately
DECLARE @OLDDATE DATETIME
SET @OLDDATE = GETDATE() -1


EXECUTE master.dbo.xp_delete_file 0,N'E:\MSSQL\Backup\Dabase_Backup',N'zip',@OLDDATE,1

nothing..
But when I change extension to bak than it works
procedure only works for files with bak extension for me.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-11-27 : 01:13:07
Probably because the cleanup task will only cleanup SQL Server files.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page
   

- Advertisement -