답변됨 diskshadow.exe

  • Tuesday, June 12, 2012 3:52 PM
     
     

    I am attempting to copy some files from a windows 2008 server using diskshadow.

    I am using the following script:

    #DiskShadow script file

    set context persistent nowriters
    set metadata c:\copydata\backup.cab
    set verbose on
    begin backup
    add volume c: alias SystemVolumeShadow
    add volume d: alias DataVolumeShadow

    create

    expose %SystemVolumeShadow% p:
    expose %DataVolumeShadow% q:


    exec c:\copydata\backupscript.cmd

    end backup

    delete shadows exposed p:
    delete shadows exposed q:
    #End of script

    if i use xcopy in c:\copydata\backupscript.cmd I get "access denied" errors along with "0 files copied" however the files and datestamps are copied, but not the contents of the files.

    if i use robocopy in c:\copydata\backupscript.cmd I get no errors  however nothing is copied.

    Is there a command which will copy files from a shadow copy created with diskshadow in the same manner as xcopy could be used with shadow copies created with vshadow.exe.

    Alternatively if there was a way I can select a nas drive as the target for a backup using "Windows Server Backup" as that would do instead.

    Thanks in advance for your assistance

All Replies

  • Tuesday, June 12, 2012 5:26 PM
     
     Answered

    Hi,

    I would suggest trying the following syntax:

    robocopy X:\shadowcopy\dir\dir Y:\dir /S /XJ /COPY:DAT /NFL /NDL /w:0 /r:0

    The header information:

    • I am copying only the dir/dir directories (change as required)
    • X being the source drive
    • Y being the destination drive
    • *.* indicates to copy all files
    • /NDL suppresses directory listings to the console
    • /NFL suppresses file listings to the console
    • /S copies the source folder and all sub folders and files
    • /COPY:DAT copies data, attributes and timestamps
    • /XJ exclude junction points
    • /R:0 number of retries on failed copies (in other words -do not re try - Edit to taste)
    • /W:0 wait between retries

    Kind Regards,

    Martin

    Credit: Richard D


    If you find my information useful, please rate it. :-)

  • Monday, June 18, 2012 8:21 AM
     
     
    Thanks for your response. The robocopy syntax you suggested was essentially what I was doing. I re run the same batch file the following day and this time it performed as expected. A bit worrying that the same code produces different results on different days, but at least it works now. So thanks again.