Multiple Network Shares

JoshDBGuyJoshDBGuy Posts: 16
edited April 27, 2015 3:29PM in SQL Backup Previous Versions
Hi All,

I'm sure this has been asked before but I'm unable to find it. I would like to add multiple network shares to the "Copy To" option but I am unsure of the syntax. Can someone help me out?

Thanks,

Josh

Comments

  • peteypetey Posts: 2,358 New member
    Use multiple COPYTO switches e.g.
    EXEC master..sqlbackup '-sql "BACKUP DATABASE model TO DISK = [<AUTO>] WITH COPYTO = [\share01sqlbackups<DATABASE>], COPYTO = [\share02sqlbackups<DATABASE>], COPYTO = [\share03sqlbackups<DATABASE>] " '
    
    Note that the backup only completes when the file(s) have been copied to all your COPYTO destinations, and will require a longer backup window. For transaction log backups, the files are copied by a separate process, so the backup completes without waiting for the files to be copied.
    Peter Yeoh
    SQL Backup Consultant Developer
    Associate, Yohz Software
    Beyond compression - SQL Backup goodies under the hood, updated for version 8
  • That's perfect, thank you so much.
Sign In or Register to comment.