Red Gate forums :: View topic - Deleting old backups from other server with Erase command
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Backup 7
SQL Backup 7 forum

Deleting old backups from other server with Erase command

Search in SQL Backup 7 forum
Post new topic   Reply to topic
Jump to:  
Author Message
Tom_NL



Joined: 02 May 2010
Posts: 10

PostPosted: Mon Sep 23, 2013 11:15 pm    Post subject: Deleting old backups from other server with Erase command Reply with quote

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
Back to top
View user's profile Send private message
petey



Joined: 24 Apr 2005
Posts: 2305

PostPosted: Tue Sep 24, 2013 5:37 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail
Tom_NL



Joined: 02 May 2010
Posts: 10

PostPosted: Tue Sep 24, 2013 8:09 am    Post subject: Reply with quote

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

Regards,
Tom
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group