Copying to multiple network locations

RichardRayJHRichardRayJH Posts: 22
edited November 27, 2011 4:36AM in SQL Backup Previous Versions
I currently use Backup Pro to make a local backup and then copy that file to a network share. I would like to copy the file to a couple of other places, also. Is there a way to use Backup Pro to accomplish that?

If I can do it directly from Backup Pro, any other suggestions? I was considering something with Robocopy or perhaps PowerShell...
-
Richard Ray
Jackson Hole Mountain Resort
Teton Village, WY

Comments

  • peteypetey Posts: 2,358 New member
    Use multiple COPYTO parameters e.g.
    EXEC master..sqlbackup '-sql "BACKUP ... WITH COPYTO = [networkshare1\backups\], COPYTO = [networkshare2\backups\], COPYTO = [networkshare3\backups\] ...
    
    Peter Yeoh
    SQL Backup Consultant Developer
    Associate, Yohz Software
    Beyond compression - SQL Backup goodies under the hood, updated for version 8
  • So if the EXEC statement looks like:

    EXECUTE master..sqlbackup '-SQL "BACKUP DATABASE [RTPOne] TO DISK = ''S:\Backup\RTP-Data\<AUTO>.sqb'' WITH ERASEFILES = 7,
    ERASEFILES_REMOTE = 15,
    FILEOPTIONS = 4,
    MAILTO = ''isadmin@jacksonhole.com'',
    DISKRETRYINTERVAL = 30,
    DISKRETRYCOUNT = 10,
    COMPRESSION = 4,
    COPYTO = ''\\n-cali\sqlbackups\RTPSQL\DataFileBackups\RTPONE'',
    THREADCOUNT = 15,
    VERIFY"',
    @exitcode OUT,
    @sqlerrorcode OUT

    then all I need is more COPYTO's and the same ERASEFILES REMOTE will apply?
    -
    Richard Ray
    Jackson Hole Mountain Resort
    Teton Village, WY
  • peteypetey Posts: 2,358 New member
    Yes, adding more COPYTO parameters is all you need to do.
    Peter Yeoh
    SQL Backup Consultant Developer
    Associate, Yohz Software
    Beyond compression - SQL Backup goodies under the hood, updated for version 8
Sign In or Register to comment.