What are the challenges you face when working across database platforms? Take the survey

Enhancement Request - Assist Tape backup

epetroepetro Posts: 69
edited June 13, 2011 12:56PM in SQL Backup Previous Versions
I'd like to make a request for enhancement to SQL Backup. But first, I would like to see if other people would benefit from this addition.

Request: Additional backup parameter that restricts 'ERASEFILES_ATSTART' to files without an archive bit.

Maybe two(2) values that work similar to the following if archive bit exists:
1 : abort, raiserror
2 : continue, no erase

The scenario:
Daily SQL backup job completes at 1:00AM with ERASEFILES_ATSTART=1h.
Tape pickup job begins at 2:00AM, but encounters an error and is not corrected for over 24 hours.
Next execution of Daily SQL backup job erases previous copy.

In my scenario the tape pickup software turns off the archive bit.

Anyone else have a use for this, please comment.


  • Options
    peteypetey Posts: 2,358 New member
    With regards to the archive bit, set bit 2 of the FILEOPTIONS value so that only files with an inactive archive flag are deleted e.g.
    EXEC master..sqlbackup '-sql "BACKUP DATABASE ... WITH ERASEFILES = 2h, FILEOPTIONS = 2"'
    For more details, see the following topic in the SQL Backup help: The SQL Backup Toolkit > Toolkit syntax > The BACKUP command. Look for the FILEOPTIONS explanation.
    Peter Yeoh
    SQL Backup Consultant Developer
    Associate, Yohz Software
    Beyond compression - SQL Backup goodies under the hood, updated for version 8
  • Options
    I tested this locally and it seems to work fine.

Sign In or Register to comment.