I have a development sql 2014 environment. I need to put all db in full recovery mode in order to test availability groups, so I need to manage logs to avoid excessive growth. I don't need to keep log backups at all since it is only a development server, I only need to keep them short. I thought to perform a log backup on disk, then shrink the log file and then delete the backup file. How can I manage this? I think I can do the most, but I think I cannot delete the backup file from sql agent. Is there a best practice about this? Thank you
Asked
Active
Viewed 178 times
-2
-
Questions must demonstrate a **minimal understanding of the problem being solved**. Try including attempted solutions, why they didn't work, and the *expected* results. See [How can I ask better questions on Server Fault?](http://meta.serverfault.com/q/3608/118258) for further guidance. – HopelessN00b Mar 14 '15 at 06:59
1 Answers
2
Don't shrink the log file. Leave the log file the size it needs to be and run log backups often enough that it doesn't grow. You can scriptomatically clean up the log backup directory regularly as part of your normal maintenance.
This backup script will run automatic cleanup (only keep files for X days). You can also write a script that runs through task scheduler.

Katherine Villyard
- 18,550
- 4
- 37
- 59