Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: ROBOCOPY - Create Backup Script


18 Sep 2011   #189
Golden

Microsoft Community Contributor Award Recipient

Windows 7 Ult. x64 Windows 8.1 x64
 
 
ROBOCOPY - Create Backup Script

How to Create a Backup Script using ROBOCOPY Command


...

My System SpecsSystem Spec
30 Dec 2012   #190
Kaktussoft

Microsoft Community Contributor Award Recipient

Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
 
 

Quote   Quote: Originally Posted by kqo View Post
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 System SpecsSystem Spec
30 Dec 2012   #191
kqo

Windows 7 Professional x64
 
 

Quote   Quote: Originally Posted by Kaktussoft View Post
Quote   Quote: Originally Posted by kqo View Post
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 System SpecsSystem Spec
14 Jan 2013   #192
carrzkiss

Windows 7 Ent. (32)
 
 

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.

Quote:
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 Windows 7 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 System SpecsSystem Spec
14 Jan 2013   #193
Jeckler

Windows 7 Enterprise x64
 
 

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 System SpecsSystem Spec
.


14 Jan 2013   #194
Golden

Microsoft Community Contributor Award Recipient

Windows 7 Ult. x64 Windows 8.1 x64
 
 

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 System SpecsSystem Spec
14 Jan 2013   #195
acornada

Windows 7 Home Premium SP-1, 64-bit
 
 

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 System SpecsSystem Spec
15 Jan 2013   #196
Kaktussoft

Microsoft Community Contributor Award Recipient

Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
 
 

Add swich /XJ as well!
My System SpecsSystem Spec
15 Jan 2013   #197
acornada

Windows 7 Home Premium SP-1, 64-bit
 
 

Quote   Quote: Originally Posted by Kaktussoft View Post
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 System SpecsSystem Spec
19 Jan 2013   #198
ROBO731

Windows 7 Home Premium x64
 
 

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 System SpecsSystem Spec
19 Jan 2013   #199
acornada

Windows 7 Home Premium SP-1, 64-bit
 
 

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 System SpecsSystem Spec
Comment

 ROBOCOPY - Create Backup Script




Tutorial Tools



Similar help and support threads for2: ROBOCOPY - Create Backup Script
Windows 7 Tutorial Category
Robocopy Backup - ERROR 5 (0x00000005) Backup and Restore
How to create batch script to lock workstation then log off. General Discussion
Robocopy backup for personal folders Backup and Restore
I Need Help To Create REG. Script With Admin. Priv. For Reg. Editor? Customization
Robocopy backup - file permissions General Discussion
Anyone use robocopy to backup? Backup and Restore
Create ErrorHandler.cmd script file General Discussion

Our Sites

Site Links

About Us

Find 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 06:29 PM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33