Hi All,
I need a generic solution to delete backup files from filesystem in order to
reduce space.
Can this be done using the extended sp "xp_cmdshell"? If yes, can any body
show me an example on how to achieve this.
ie.., i want to write a SP and add it to SQL Jobs. I want that SP to delete
all files in a specific folder which are older then "N" number of hours.
Its really very urgent. Can anyone give me a quick solution / sample.
Regards
PrasanthIF you are using a Maintenance plan for creating the backups, then you have
an option when you are setting up the plan through the wizard where you can
use the option
"Remove files older than"
If you cannot do that, you can use a vbscript to automate the delete.
On how to do that.. check out this link..
[url]http://www.sqlservercentral.com/columnists/hji/usingvbscripttoautomatetasks.asp[/u
rl]
Hope this helps.|||As omnibuzz suggested vbscript is the way to go.
If at you are not interest in that for some reason! then try these
suggestions:
1. How about writing a batch script to do this job. THen you can call this
bat file within a sqljob and schedule it.
2. Write a windows application to do and then schedule it using Windows
Scheduler.
3. Write a Windows service to do this job.
Best Regards
Vadivel
http://vadivel.blogspot.com
"SqlBeginner" wrote:
> Hi All,
> I need a generic solution to delete backup files from filesystem in order
to
> reduce space.
> Can this be done using the extended sp "xp_cmdshell"? If yes, can any body
> show me an example on how to achieve this.
> ie.., i want to write a SP and add it to SQL Jobs. I want that SP to delet
e
> all files in a specific folder which are older then "N" number of hours.
> Its really very urgent. Can anyone give me a quick solution / sample.
> Regards
> Prasanth
Showing posts with label xp_cmdshell. Show all posts
Showing posts with label xp_cmdshell. Show all posts
Sunday, March 25, 2012
Sunday, March 11, 2012
deleted xp_cmdshell... how do I restore it?
For security reasons I dropped xp_cmdshell from my master database. Now
I find that I need it once again... is there a way to restore it or
somehow copy it from another database server? I've tried to use
enterprise manager to DTS it over but I can't DTS anything from the
master database. Is there any other way?
Thanks in advance.
Rsto create it back use the following and let know if it works:
Use Master
sp_addextendedproc xp_cmdshell, 'xplog70.dll'
I find that I need it once again... is there a way to restore it or
somehow copy it from another database server? I've tried to use
enterprise manager to DTS it over but I can't DTS anything from the
master database. Is there any other way?
Thanks in advance.
Rsto create it back use the following and let know if it works:
Use Master
sp_addextendedproc xp_cmdshell, 'xplog70.dll'
deleted xp_cmdshell... how do I restore it?
For security reasons I dropped xp_cmdshell from my master database. Now
I find that I need it once again... is there a way to restore it or
somehow copy it from another database server? I've tried to use
enterprise manager to DTS it over but I can't DTS anything from the
master database. Is there any other way?
Thanks in advance.
Rsto create it back use the following and let know if it works:
Use Master
sp_addextendedproc xp_cmdshell, 'xplog70.dll'
I find that I need it once again... is there a way to restore it or
somehow copy it from another database server? I've tried to use
enterprise manager to DTS it over but I can't DTS anything from the
master database. Is there any other way?
Thanks in advance.
Rsto create it back use the following and let know if it works:
Use Master
sp_addextendedproc xp_cmdshell, 'xplog70.dll'
Subscribe to:
Posts (Atom)