Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create only one backup file for a SQL Server database

I've created a Back Up Database Task for a few selected databases in my server. What I want to do is to have only one backup file for any database. The new one could overwrite the old one or create a new one and delete the old one, doesn't matter. I've checked Backup set will expire: 2 days but but evidently this doesn't do what I thought it'd do, it keeps creating new backup files every day. How can accomplish this?

like image 359
dstr Avatar asked Feb 06 '26 15:02

dstr


1 Answers

I wouldn’t set the backup to expire in 2 days, as this means that you can only restore the backup for two days once the backup expires you can no longer rebuild the database using it.

In the same why you built a maintenance plan to backup the database you can create a maintenance plan to clean up the system and delete backup over x days old. then just run it after your backup plan.

like image 166
TheAlbear Avatar answered Feb 09 '26 11:02

TheAlbear



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!