Backup files not being deleted

philcartphilcart Posts: 45
edited June 12, 2007 5:40AM in SQL Backup Previous Versions
Running SQL Backup 5.1.0.2781 on SQL Server 2005 (SP2)

This is the command thats being issued,
BACKUP DATABASE [myDB]  TO DISK = 'H:\backup_share\<AUTO>.sqb' 
WITH NAME = '<AUTO>', DESCRIPTION = '<AUTO>', 
COPYTO = '\\SQL2\db', FILEOPTIONS = 7, 
ERASEFILES = 2, COMPRESSION = 2, THREADCOUNT = 7

By my reading SQL Backup should be erasing all files that are more than two days old in both the primary and COPYTO locations, which it is not doing. No files are being deleted at all.

If the command is not correct, please advise what I need to change so the command works.

Thanks
Phil

Comments

  • peteypetey Posts: 2,358 New member
    The using FILEOPTIONS = 7, which includes bitmask 1 (the value 2), SQL Backup will only delete files that do not have the archive attribute.

    The archive attribute is usually set by default. It is usually cleared by tape backup applications, to indicate that the file has been archived to tape, and need not be archived again.

    If you want to delete the file regardless of the archive attribute, then use FILEOPTIONS = 5.
    Peter Yeoh
    SQL Backup Consultant Developer
    Associate, Yohz Software
    Beyond compression - SQL Backup goodies under the hood, updated for version 8
  • So will FILEOPTIONS=5 delete files in both the primary and COPYTO locations?

    Thanks
Sign In or Register to comment.