Backup Retention Period

  • Hi,

    I have created a backup of one of my databases. The backup is stored on a different server. I want to set a retention period for the backups. But I can only set the retention period within a maintenance plan. I don't want to use a maintenance plan to backup the databases. BOL suggested these steps below.

    1.Expand a server group.

    2.Right-click a server, and then click Properties.

    3.Click the Database Settings tab.

    4.In the Default backup media retention (days) box, type or select a value from 0 through 365 to set the number of days the backup medium will be retained after a database or transaction log backup.

    The default value is 0 days.

    Does this work on all databases backed up on your server? Will this work on database backups not stored locally? Will the server require a reboot?

    Regards

    IC

  • Since you don't want to use maintenance plans I assume you use your own scripts. To define the retention period just use the RETAINDAYS option.

    Something like:

    BACKUP DATABASE pubs TO DISK='C:\Backup\pub.bak' WITH RETAINDAYS = 1

    Markus

    [font="Verdana"]Markus Bohse[/font]

  • Are you not backing up to different files each day? Going to the same file is a bad idea.

    If you use different files, set a script, prob VB or Powershell, that will remove any files older than xxx days.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply