Deleting old backups from other server with Erase command

Compresses, encrypts, secures and monitors SQL Server backups.

Moderators: JonathanWatts, Chris Auckland, eddie davis, Colin Millerchip, Brian Harris, james.billings, RBA, petey

Deleting old backups from other server with Erase command

Postby Tom_NL » Mon Sep 23, 2013 11:15 pm

In the past weeks we have moved all out SQL databases to new servers with SQL 2012. While moving our databases we also moved our old SQL backups to this new servers, because we always maintain a backup history of 45 days.

To remove backups older then 45 days we use a SQL agent job with the command

EXECUTE master..sqlbackup '-SQL "ERASE FULL_BACKUPS FOR [database name] FROM DISK = ''Local Path to backup folder]'' KEEP = 45 "'

We have used this job for ages, but on our new servers the job does not seem to delete any old SQLbackups, almost resulting in full harddisks

After a lot of debugging i found that the command only deletes files created by the server running the job. Probably it compares the servername with the servername from the backup header.
Because we moved the backups grom our old servers to the new servers, the backups originaly made by one of the old servers are not being deleted after 45 days.

I cannot find anything about this issue in the documentation, is this by design?
Is there a way to work around this behaviour?

Regards,
Tom
Tom_NL
 
Posts: 10
Joined: Sun May 02, 2010 8:25 am

Postby petey » Tue Sep 24, 2013 5:37 am

Yes, that is by design. We always want to minimize the number of accidental deletions, hence why the strict deletion conditions.

At present, there is no workaround for this.
Peter Yeoh
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 7
petey
 
Posts: 2233
Joined: Sun Apr 24, 2005 12:34 pm

Postby Tom_NL » Tue Sep 24, 2013 8:09 am

I understand the desission, but it would be nice to have some kind of override for this.

Regards,
Tom
Tom_NL
 
Posts: 10
Joined: Sun May 02, 2010 8:25 am


Return to SQL Backup 7

Who is online

Users browsing this forum: No registered users and 0 guests