Backups

  • i am tired of manually logging into server and executing xp_cmd to delete old backups. I want to be able to create a stored proc that will enable me to view all old backups and if there is more then one backup for a database then it will be deleted. Where do i start:cool:

  • I don't do this myself because we overwrite backup files, but if you search this site for something like "delete backups", you'll find tons of scripts and advice on how to do this in T-SQL, vbscript, etc.

    Greg

  • The attached is a presentation done at a SQL Saturday event I went to in Birmingham, AL. It includes some scripts for creating the maintenance plans/jobs that includes one used to clean-up old backup files.

    Shawn Melton
    Twitter: @wsmelton
    Blog: wsmelton.github.com
    Github: wsmelton

  • Are you using SQL's native Backup utility? If so why don't you specify how many days old the backups can be? This way SQL will automatically delete the backup files for the time specified. I use a maintenance plan and it keeps 4 days of full backups and translogs and deletes the ones that become outdated automatically. There is absolutely no manual intervention.

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

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