Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2003
    Posts
    46

    Unanswered: Problems with backup script

    I'm trying to modify a backup script so that it will keep 2 days of backups. My latest change allowed it to keep 2 days, but it's not deleting the older backups after they expire. (that means it's keeping things that are 3 and 4 days old...that starts to eat disk space REAL fast)

    NOTE: I'm storing all of the backups (full and transaction log) in a backup device.

    Here's the script I'm call for the full backup:
    <code>
    BACKUP DATABASE c2000
    TO c2000_BackupDevice
    WITH
    DESCRIPTION = 'Full'
    , RETAINDAYS = 2
    , NOINIT
    , NAME = 'Daily Backup'
    , NOSKIP
    , STATS = 5
    </code>

    It should be related to the retaindays, INIT/NOINIT, and SKIP/NOSKIP parameters...but it's not doing what I expect it to do.

    Can anybody set me straight on this one?

    Thanks,

    alex8675

  2. #2
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    init and noinit govern whether the file is overwritten or appended to respectively. If this is a disk device, then the file will simply grow over time. The retaindays parameter (after reading the description) must populate the either the header of the backup device, or a field in msdb as to when the device is available to be overwritten.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •