Delete Backups after a successful restore

dscott_mscdscott_msc Posts: 2
edited September 13, 2015 10:45PM in SQL Backup Previous Versions
I am using the restore feature of Backup Pro 7, to test the backups by restoring to a new database .
The software has a facility to drop the new database on successful restore.

I would also like to use the successful restore status to delete old backups.

Does anyone have any ideas ?

Thanks in advance

David Scott

Comments

  • peteypetey Posts: 2,358 New member
    Do you mean you want to delete the backup file the database was restored from? There isn't a way to do this easily. The closest way I can think of is to use the ERASEFILES_PRIMARY option with the value '1h', which means that your backup file needs to be older than one hour at the time of the restore, in order for it to be deleted. Outside of SQL Backup, if you're running the restore tests using a scheduled job, one suggestion is to rename the backup file to a known name, perform the restore, then delete that backup file.
    Peter Yeoh
    SQL Backup Consultant Developer
    Associate, Yohz Software
    Beyond compression - SQL Backup goodies under the hood, updated for version 8
Sign In or Register to comment.