ROBOCOPY - Create Backup Script

Page 20 of 32 FirstFirst ... 10181920212230 ... LastLast

  1. Posts : 10,796
    Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
       #190

    kqo said:
    Thank you for all your replies.
    @Golden My Appdata folder is just 4.62GB. I will try it without the /z option and reply
    @acornada I thought the /e option meant Robocopy should copy all subdirectories and even empty ones.
    @Kaktussoft can you explain a bit better about the /XJ switch as this is the explain from the link you posted"/XJ :: eXclude Junction points. (normally included by default)."

    Thank you guys
    It simply excludes junction points.

    In command prompt goto %userprofile%\AppData\Local

    Code:
    c:
    cd  %userprofile\Appdata\Local
    now look what is in it
    Code:
    dir
    Now look what is in subfolder dir "Application Data"

    Code:
    dir "Application Data"
    Do you see it's the same? So dir "Application Data" points to same folder.
    So %userprofile\Appdata\Local\"Application Data" is %userprofile\Appdata\Local
    So %userprofile\Appdata\Local\"Application Data"\"Application Data"\"Application Data"\"Application Data"\"Application Data"\"Application Data" is %userprofile\Appdata\Local

    It is backupping things maybe 10 times until filename is too long.
      My Computer


  2. kqo
    Posts : 3
    Windows 7 Professional x64
       #191

    Kaktussoft said:
    kqo said:
    Thank you for all your replies.
    @Golden My Appdata folder is just 4.62GB. I will try it without the /z option and reply
    @acornada I thought the /e option meant Robocopy should copy all subdirectories and even empty ones.
    @Kaktussoft can you explain a bit better about the /XJ switch as this is the explain from the link you posted"/XJ :: eXclude Junction points. (normally included by default)."

    Thank you guys
    It simply excludes junction points.

    In command prompt goto %userprofile%\AppData\Local

    Code:
    c:
    cd  %userprofile\Appdata\Local
    now look what is in it
    Code:
    dir
    Now look what is in subfolder dir "Application Data"

    Code:
    dir "Application Data"
    Do you see it's the same? So dir "Application Data" points to same folder.
    So %userprofile\Appdata\Local\"Application Data" is %userprofile\Appdata\Local
    So %userprofile\Appdata\Local\"Application Data"\"Application Data"\"Application Data"\"Application Data"\"Application Data"\"Application Data" is %userprofile\Appdata\Local

    It is backupping things maybe 10 times until filename is too long.
    Thank you very much @Kaktusofft the explanation you gave above was exactly the problem. I noticed initially that when i ran the script without the /XJ switch it would get to a stage and start backing up Appdata\Local\Application Data\Application Data and the same path is repeated just as you explained.
    My script worked fine after using the /XJ switch and 1 hour 20 mins later my backup was done to the server.
    @Golden thank you for creating this thread i am grateful.
      My Computer


  3. Posts : 1
    Windows 7 Ent. (32)
       #192

    How is everyone doing?
    OK, this is my situation.

    I have never had an issue using Robocopy on XP or Win2k3 Server.
    However, with Windows 7, it is a complete nightmare.

    OK

    Running a simple script like this:

    @robocopy "M:" "K:/Archive Files"

    I receive the following error, of which I had to record the screen to view the error message.

    Source: M:\" K:\Archive\
    Dest: K:\Files
    Files: *.*
    Options......
    -------------------
    2013/01/14 13:19:03 Error 123 (0x0000007B) Accessing Source Directory M:\"K:\Archive\
    The filename, directory name, or volume label syntex in incorrect.
    So, my question is this.
    How do you use the new Win7 Robocopy?
    I need to wrap my folders with spaces in them, and this is causing me some major headache.

    I did a complete backup of over 200GB's last night, and woke up this morning, to:
    1 drive completed successfully
    1 drive, missed 1/2 of its files.
    3 Drives, copied only the folder names, but no files over.

    The code I used for that, was something like this, for the folders.

    @robocopy M: K:/Archive Files
    @robocopy M: K:/DriveB
    @robocopy M: K:/Drive A

    As you can tell, the only one that copied over completely was the /DriveB

    Any help on this issue, will be mighty grateful
    Carrzkiss
      My Computer


  4. Posts : 12
    Windows 7 Enterprise x64
       #193

    I don't think the quotes are necessary for the source and use \ instead of / for the target. You may need to exclude some folders too (/XD), as robocopy might try and copy your Recycle Bin, hidden as RECYCLER in the root of M:.
    /E might be needed, especially if some of the folders are empty and you want them copied anyway.
      My Computer


  5. Posts : 19,383
    Windows 10 Pro x64 ; Xubuntu x64
    Thread Starter
       #194

    Hi,

    Run the .bat file as Administrator (right-click it and click 'Run as administrator')

    Try this in your script:

    Code:
    robocopy M:\ K:\ArchiveFiles /e /copyall
    robocopy M:\ K:\DriveB /e /copyall
    robocopy M:\ K:\DriveA /e /copyall
    Regards,
    Golden
      My Computer


  6. Posts : 26
    Windows 10 Home, 64-bit
       #195

    Don't add the trailing slash when copying root of a drive.

    Exclude "$RECYCLE.BIN" "System Volume Information", as you likely don't want them backed up. Other options may also be useful, if you told us what you wanted.

    Right-click your .bat file and select "Run as Administrator".

    Below are the commands to use for what you've so far said you want (note discrepancy in naming between "DriveB" and "Drive A", and decide if you intended it).

    ROBOCOPY "M:" "K:\Archive Files" /COPYALL /MIR /XD "$RECYCLE.BIN" "System Volume Information" /XF DESKTOP.INI

    ROBOCOPY "M:" "K:\DriveB" /COPYALL /MIR /XD "$RECYCLE.BIN" "System Volume Information" /XF DESKTOP.INI

    ROBOCOPY "M:" "K:\Drive A" /COPYALL /MIR /XD "$RECYCLE.BIN" "System Volume Information" /XF DESKTOP.INI
      My Computer


  7. Posts : 10,796
    Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
       #196

    Add swich /XJ as well!
      My Computer


  8. Posts : 26
    Windows 10 Home, 64-bit
       #197

    Kaktussoft said:
    Add swich /XJ as well!
    Yes, I would, and I would add other options. But the poster hasn't told us what he wants, so it's hard to know what options are appropriate.
      My Computer


  9. Posts : 223
    Windows 7 Home Premium x64
       #198

    Would this work If it was backing up files that were currently open and being used? For example I want to use it to backup a minecraft server. Would I need to stop the server and then back it up or could I just do it while it's on and I'm playing?
      My Computer


  10. Posts : 26
    Windows 10 Home, 64-bit
       #199

    Some types of files don't copy properly when in use. You may want to check some Robocopy resources on the www for more information.
      My Computer


 
Page 20 of 32 FirstFirst ... 10181920212230 ... LastLast

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 04:33.
Find Us