Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Deleting Older backups Expand / Collapse
Author
Message
Posted Thursday, April 1, 2010 12:04 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, August 16, 2010 4:03 PM
Points: 7, Visits: 35
Hi guys, I am new to sql and Litespeed

Here is my situation

We take daily Production(PRD) backup which is litespeed backup using sql serevr 2005 and transfer or FTP to other servers (UAT) for storing for 3 days or less.I want to create a maintenance plan using SQL or Litespeed to delete older backups from the particular folder.

I crated Maintenance plan using SQL 2005 in UAT server to delete 3 days old PRD backups. The job executes with out any error and shows it successful but its not deleting any backups.I tried all types of file extensions like bak, .bak, *.*

Do you think UAT sql 2005 is not able to delete backups created by PRD sql server 2005?
Do you think sql 2005 is not capable of deleting litespeed backups?

Is there any other way to create a maintenance plan using litespeed to delete old backups please suggest.

Thanks
Post #894446
Posted Thursday, April 1, 2010 12:44 AM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Yesterday @ 10:32 PM
Points: 18,055, Visits: 16,087
I think I would explore other alternatives than the maint plan from the UAT server. Some possible options: ssis package, Powershell, sql script using xp_cmdshell, or an OS script that runs to perform this task.



Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server, MVP


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Post #894461
Posted Saturday, April 3, 2010 3:08 PM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Tuesday, November 12, 2013 10:53 PM
Points: 290, Visits: 714
Create an SP which uses the xp_cmdshell and use the del command along with it.
Call the SP through a SQL agent job. Schedule the job for daily run.


John
Post #896321
Posted Saturday, April 3, 2010 4:09 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Yesterday @ 5:38 PM
Points: 31,355, Visits: 15,819
I would think that it could delete the backups, but perhaps it's looking in msdb for something.

What I'd suggest is that you look for a script with Powershell or VBScript/FileSystemObject that deletes files older than xx days. Then run that from Agent as a Command Shell command.

Here's one: http://www.sqlservercentral.com/scripts/Miscellaneous/31627/







Follow me on Twitter: @way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #896324
Posted Saturday, April 3, 2010 4:29 PM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Tuesday, November 12, 2013 10:53 PM
Points: 290, Visits: 714

Hi,

I believe, we can also take the date info with the help of MS DOS commands through xp_cmdshell and take it for the calculation of backup file retention and deletion.

So, we may not have to go to msdb.dbo.backupset for the date info.

Steve, correct me if I'm wrong.



John
Post #896330
Posted Sunday, April 4, 2010 6:59 AM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Yesterday @ 6:55 AM
Points: 9,928, Visits: 11,203
sql_time (4/1/2010)
Do you think sql 2005 is not capable of deleting litespeed backups?

I believe that the Maintenance Clean-up Task can only clean up backup files created directly by the Back Up Database Task. As far as I remember, LiteSpeed backups can only be invoked by calling an extended stored procedure, and so have to be set up using the Execute T-SQL Statement Task.

Unless you are able to use native SQL Server backup rather than LiteSpeed (allowing you to use the Back Up Database Task), it looks like you will have to write a script manually to find and delete old files. Be very careful with this, as it is all too easy for a bug in the script to delete files it should not.

Paul




Paul White
SQL Server MVP
SQLblog.com
@SQL_Kiwi
Post #896403
Posted Sunday, April 4, 2010 9:10 AM
SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Friday, December 12, 2014 12:03 PM
Points: 4,363, Visits: 9,547
Litespeed comes with it's own litespeed maintenance utility for deleting old backup files. Look in the documentation for litespeed on the command line utilities.



Jeffrey Williams
Problems are opportunites brilliantly disguised as insurmountable obstacles.

How to post questions to get better answers faster
Managing Transaction Logs
Post #896420
Posted Sunday, April 4, 2010 9:26 AM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Yesterday @ 6:55 AM
Points: 9,928, Visits: 11,203
Just checked the Quest site, and it appears that the latest release (5.2.0) does support the Cleanup History task. See http://www.quest.com/Quest_Site_Assets/PDF/LiteSpeed_520_ReleaseNotes.htm



Paul White
SQL Server MVP
SQLblog.com
@SQL_Kiwi
Post #896421
Posted Sunday, April 4, 2010 3:23 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, August 16, 2010 4:03 PM
Points: 7, Visits: 35
Hello Guys,

Thanks for every one for your valuable suggestions, as suggested by Jeffrey Williams I created a maintenance plan using clean up maintenance task in Litespeed, and it works perfectly right.

The lite speed architecture is almost similar to SQL maintenance task, its easy as sql.I created the task one week back and its working fine.

Once again Thanks for every one, u guys rock.
Post #896488
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse