December 17, 2008 at 9:48 am
Hi,
I have created a maintenance plan in such a way that it will take the backup of a database everyday and it will delete the file from the path which is older than 2 days...everthing works fine its been a month ..now it is not deleting the file which are older than 2 days on weekends but on weekdays it is deleting ..only on weekends my job fails due to free space problems as it is not deleting the older files ...Thanks in advance...
Thanks,
Chinna
Its the Journey which gives you Happiness not the Destination-- Dan Millman
December 17, 2008 at 10:37 am
Have u created your own maintaince plan??, if so can you post the script so we can have a look on that
December 17, 2008 at 1:15 pm
EXECUTE master.dbo.xp_delete_file 0,N'G:\DB_Backup',N'bak',N'2008-12-15T15:14:42',1
this is the delete tsql code ..please do let me know if any changes...
Thanks,
Chinna
Its the Journey which gives you Happiness not the Destination-- Dan Millman
December 18, 2008 at 1:45 am
Are you sure the job is running during the weekend? SQL itself is not aware of the weekday when running a job.
December 18, 2008 at 8:10 am
I am srry i came to know tht the other guy is deleting manually on weekdays ...so it is not at all deleting anyday ...srry abt that and it used to delete before but not anymore...
Thanks,
Chinna
Its the Journey which gives you Happiness not the Destination-- Dan Millman
December 18, 2008 at 11:20 pm
Schedule this command in a job to delete all backups that are older then 2 days:
DECLARE @Date DateTime
SET @Date = GetDate() -2-- determine date of day before yesterday
EXECUTE master.dbo.xp_delete_file 0, N'{path}', N'BAK', @Date
Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply