I have the following issue with Maintenance plan backups that work for BAK DIF and TRN to a remote server share.
When I try and remove the old files with a clean up task I get an error and the files don't get deleted.
The version is as follows
Microsoft SQL Server 2005 - 9.00.3054.00 (X64) Mar 23 2007 18:41:50
Copyright (c) 1988-2005 Microsoft Corporation Standard Edition (64-bit) on
Windows NT 5.2 (Build 3790: Service Pack 2)
The error result is as follows,
Failed-1073548784) Executing the query "EXECUTE master.dbo.xp_delete_file
0,N'\\\\EXECUTE master.dbo.xp_delete_file 0,N'\\\ABCD-A1\\BACKUPS\\ABCD_BACKUP\\ABC_DAILY\\ABCD',N'trn',N'2008-01-13T12:52:49'" failed with the following error: "xp_delete_file() returned error 2, 'The
system cannot find the file specified.'". Possible failure reasons: Problems
with the query, "ResultSet" property not set correctly, parameters not set
correctly, or connection not established correctly.
The maintenance plan seems to be adding extra "\" though when i enter the
code directly in a query i get same error.
xp_delete_file() returned error 2, 'The system cannot find the file specified.'
The servers belong to the same domain and are using the same Service account which has all the necessary rights to the share and the file directory location. The backups work but i get the error on the cleanup task.
Trying to figure out how to get the Cleanup task to delete old files. The same happens for all file extensions and I have tried other locations with simpler file paths same error.
Hi I am not an Programmer just a server admin..
I have managed to setup a backup job to backup a database onto the local drive (.bak files) I would like to setup auto deletion of the backup files 8 days after creation can you guys help me? I have tired History clean-up task but not sure if this is what i should be doing as there has been no affect on the old backups...
Thanks in advance for your help
P.S hope you dont mind me jumping onto your post just thought they are similar and may get the same sort of answers..
Yes maintenance clean up tasks, search for folder and delete put your path here and then in file extension put in bak tick the include first level sub folders, delete files after x days.
This will then create a SQL job look under sql server agent, here i used the login of sa if i used another account i had problems so i left this as sa. It should be able to run as the account that sql is running but i could not get it to work.
Remember, the sql agent service account must be sysadmin and have the rights in the folder where the backup files reside.
Second, if you setup the maintenance plan remember not to put the ".bak" in the file extension just put "BAK" because the job is going to failed and give you the message of cannot find the file.
I'd tested with maintenance plans in 2005/2008 and both of them work.
If you have any concern or any question don't hesitate in contact me.
Have a nice day.