Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xp_delete_file is not working

Status
Not open for further replies.

thamms

MIS
Sep 13, 2007
44
ZA
Hi,

I have a maintenance plan that's set to delete bak files older than 3 days. Here's the t-sql:

EXECUTE master.dbo.xp_delete_file 0,N'C:\MSSQL\BACKUP',N'bak',N'2007-11-10T07:34:36'

However, when I ran this today from mgmt studio, it did not delete anything from the directory, even though it said "successful" nor does it work from the job.

Haven't had this problem before on any other servers.

??

Thanks
 
What are the dates on the files in the folder?

Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005) / Database Developer (SQL 2005)

My Blog
 
The dates on the files in the folder are older than 3 days old.

That's why I don't understand why this isn't working.

I am using this exact same process on other servers and it works fine. In other newsgroups, this appears to be a problem other people are having also, possibly some type of bug.

We are on SP2.

 
Is the date in your command hard coded, or is it a variable?

It's possible that it's a bug. Check and see if anyone has submitted it, and if not submit it to them.

Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005) / Database Developer (SQL 2005)

My Blog
 
The command is automatically generated by the maintenance task, and yes it appears to be dynamically generated, if you view the t-sql.
 
I would check connect then and see if it's been posted up there.

Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005) / Database Developer (SQL 2005)

My Blog
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top