Copy backup files from one server to another

  • Hai guys

    how can i transfer backup files from one server to another using xp_cmdshell

    wht i am trying to execute is

    exec xp_cmdshell 'copy D:\testbackup\*.bak \\ushigmnsrvr\c:\test\backuptest\'

    error cmg as network path not found

    any rights prob or any configuration needed?

    pls help

  • You are probably having rights problem.

    What is your service start up account? It should preferably be domain account and should have write access to the path.

    ----------------------------------------------------------------------------------------------------------------------------------------------------
    Roshan Joe

    Jeff Moden -Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • Hi,

    Are you backing up directly to another system without share or using a share. I hope you are running win2003 or win2000

    If you are running using a share snytax should be (here iam assuming the share name as c)

    exec xp_cmdshell 'copy d:\testbackup\*.bak \\ushigmnsrvr\c\test\backuptest\'

    if you are having a share as mybackup then the syntax should be

    exec xp_cmdshell 'copy d:\testbackup\*.bak \\ushigmnsrvr\mybackup\test\backuptest\'

    If you are not using any shares then

    exec xp_cmdshell 'copy D:\testbackup\*.bak \\ushigmnsrvr\c$\test\backuptest\'

    I recommend you to use shares. And also make sure that the service account under which the sql server runs has permissions on the destination drive or share.

    [font="Verdana"]Thanks
    Chandra Mohan[/font]

  • Pls Ignore my message. I did not notice the path you used.

    What Chandra said is correct. The problem is with the share name. After that you sort out the rights issue.

    ----------------------------------------------------------------------------------------------------------------------------------------------------
    Roshan Joe

    Jeff Moden -Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • thanks yaar thanks a lot.its done

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply