April 13, 2005 at 9:48 am
I have a requirement to copy a backup file from one drive to another after a asuccessful back up and then delete the previous x days backups from the target drive.
I have an activex dts package to do this, but would like to make it parameter driven so that for different databases, which get backed up and copied to different volumes and at different times, I can pass in source directory, target directory and number of days into the DTS package.
Is there anyway to achieve this
Cheers
April 14, 2005 at 1:25 am
You don't need to use DTS.
Using xp_cmdshell, execute ROBOCOPY (from the Windows Resource Kit) to copy the files. You could use standard Copy or XCopy, but ROBOCOPY is a lot more reliable. Again using xp_cmdshell you can run a DIR command to list the files and then choose which ones to delete.
This makes it a simple stored procedure which you can run at the end of the backup process.
--------------------
Colt 45 - the original point and click interface
April 15, 2005 at 3:54 am
Phil,
How does one access cursor of output that is returned to be able to interrogate the results
April 15, 2005 at 4:18 am
Sorry Phil
This should have said
How does one access cursor of output that is returned to be able to interrogate the results of xp_cmdshell 'dir'
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply