April 1, 2009 at 3:39 am
Hi. I have a maintenance plan that backs up the production system. A clean up job then runs and deletes .bak files older than 2 days from this backup location (I backup the .bak files from that directory to tape, if I allow a build up of .bak files in this location there are space issues writing to tape media).
I would like to create a Job that copies .bak files from the default backup location to a network share.
I could then run a cleanup routine on the network share monthly.
I was thinking of implementing the following copy Script:
xcopy e:\Backup-Location\*.* \\ServerA\NetworkShareName\ /M /E /V /C /Y
Can anyone advise on this? Any better approaches?
Thanks,
Phil.
Update:
The xcopy works. However I want each time the job runs to add to the location not overide the existing file.
-------------------------------------------------------------------------------------
A neutron walks into a bar. "I'd like a beer" he says. The bartender promptly serves up a beer. "How much will that be?" asks the neutron. "For you?" replies the bartender, "no charge."
Two hydrogen atoms walk into a bar. One says, 'I think I've lost an electron.' The other says 'Are you sure?' The first says, 'Yes, I'm positive... '
Tommy Cooper
April 1, 2009 at 6:35 am
Have a look at Robust Copy (robocopy); downloadable as part of a Windows resource kit. By default that will not overwrite files at the destination.
[font="Courier New"]robocopy e:\Backup-Location\ \\ServerA\NetworkShareName *.bak[/font]
Or, depending on the size of the backup and performance of the network, the MIRROR option on the backup command can be used to place the backup directly on the network share.
[font="Courier New"]BACKUP DATABASE Northwind
TO DISK = 'e:\backup-locationorthwind.bak'
MIRROR TO DISK = '\\ServerA\NetworkShareNameorthwind.bak'[/font]
April 1, 2009 at 11:46 am
Thanks for the reply. I have xcopy working as required, just going to browse the scripts section to find a script to delete from the network share.
I will also check out robocopy.
Many Thanks,
Phil.
-------------------------------------------------------------------------------------
A neutron walks into a bar. "I'd like a beer" he says. The bartender promptly serves up a beer. "How much will that be?" asks the neutron. "For you?" replies the bartender, "no charge."
Two hydrogen atoms walk into a bar. One says, 'I think I've lost an electron.' The other says 'Are you sure?' The first says, 'Yes, I'm positive... '
Tommy Cooper
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply