July 15, 2011 at 1:46 am
Hi All,
I created clean up maintenance job to delete the backup files older than 3 days and scheduled to run that alternative days,but that plan is not deleting the old back ups, any suggestion for this?
July 16, 2011 at 4:37 pm
check very carefully what you have specified the task to do. Its probably something simple like directory path wrong or putting the suffix incorrectly (i.e. .bak when it should just be bak)
---------------------------------------------------------------------
July 18, 2011 at 4:45 am
Dubbel check ur directory path and you have to mention .bak in folder so MPL understand which want to delete or suffix incorrectly i.e. .bak. There is option when you create MPL for delete or clean history etc.
July 19, 2011 at 3:51 pm
Sometimes maintenance plan cleanup tasks stop clearing out old backups. Even though it all appears correct in the fields, for some reason it doesn't work properly.
I have found that just deleting the entire maintenance plan and recreating it will normally fix this.
When you delete the maintenance plan, it should also delete the associated job.
Once I observed an issue where the cleanup task was not functioning properly, but the job could not be deleted and was still there after the maintenance plan was deleted. I had to go into the MSDB table to delete the row that was blocking me from deleting the job.
Then once a new maintenance plan was created, everything worked correctly.
July 20, 2011 at 9:47 pm
Hi
What I have done in order to keep multiple backups is you take you datepart (day) when you build the backup string.
As below
name = convert(nvarchar(8),getdate(),112) + '_' + convert(varchar(2),datepart(day,getdate() % 2)
This does a modulus of 2 on the date. So every second day you can overwrite the backup of 2 days ago.
Now you can apply similar logic to delete backups from 3 days ago.
It will work for most of the months. 🙂
Cheers
Jannie
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply