Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

delete db backup file BEFORE next backup runs

Status
Not open for further replies.

jcaulder

Programmer
Apr 22, 2002
241
US
Is there a simple command or job that can be used to delete a previous backup file BEFORE the next backup is created in SQL Server?

The server does not have enough disk space to keep the previous days backup while the new backup is being created. It would seem easy to create a job to do nothing but delete the previous .bak file a minute before the new backup job is scheduled. The previous days backup is stored on tape prior to the delete so it can be recovered if necessary.

Thanks!
 
Yes, if you make a mantenance plan you can do that
right click on database + all task + maintenance plan + "select any option u want" + Next + "select any option u want" + Next + "select any option u want" + Next + "select any option u want" + Next + Check the box for option Remove files older than + then you can give any option.

hope this will work
naveed
 
I don't see an option for deleting the old backup BEFORE the next backup runs though. When the standard backup maintenance plan runs, it only deletes the previous backup upon successful completion of the current backup(and with good reason).

My problem is that the hard drive doesn't have enough room to hold the old backup while the new backup is created. Therefore the current backup fails because it runs out of disk space.

Is there a command/stored proc/etc to just delete a file with name like *.bak?

Thanks for your response!
 
which SQL version you are using...i told you in SQL2000
 
its 6th window when you press next+next+...next, the window name is 'Specify Backup Disk Directory'

and option is

'Remove files older than"

You can chose your option
 
I understand what you're saying but the problem is that what you're referring to performs the delete AFTER the backup process. I need the delete to occur BEFORE the backup.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top