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   #99
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 Jul 2012   #100
jamerson

Win7 64bit
 
 

Quote   Quote: Originally Posted by Golden View Post
Hi,

Is this path correct?

C:\Users\JamesAppData\Local\Microsoft\Outlook

or should it be

C:\Users\James\AppData\Local\Microsoft\Outlook

You can edit the BAT file and correct the path if required, and try it again please?
Thank you Golden, yes i notice this befoer and i edite the script somehow it also doesn't have access to some folder like my Pictures ect.... it says No access to this folder

thank you

is it possible to add some information to the scripte? like informing the user that the back up is processes and please wait...?


My System SpecsSystem Spec
07 Aug 2012   #101
callbrady

Windows 7 Ultimate 32bit
 
 
2 questions for Robocopy

Golden, First off, thanks for the original tutorial. A wonderful help indeed. I'd especially like to thank you, however, for all of your follow up in the thread. Your diligence is greatly appreciated.

I'm planning to implement Robocopy for a small school so that the documents for every faculty member (about 30) will back up to the server when they login or logoff. I have two questions.

1: If the laptop is offsite and not connected to the network, will the script fail gracefully and quickly, or will it hang up the user? Do I need to implement a network check before the script runs?

2: If a user is in a great rush, can they just close the window for the Robocopy, thus allowing the user to shut down faster? Again, does it fail gracefully, or will it keep retrying, tying up the user?

Many many thanks for your assistance.

Brady
My System SpecsSystem Spec
07 Aug 2012   #102
callbrady

Windows 7 Ultimate 32bit
 
 
Also

Our ultimate goal is to have user's data backup on login and logoff to the server. No pst files, mostly documents, spreadsheets, and pictures. WIndows 7 clients backing up to Server 2008.

Below is my 1st attempt with Robocopy, and it seems to be working well. Would you mind proofing it for any glaring errors or omissions?

robocopy c:\users\bgilbert2 \\servername\faculty\bgilbert2 /e /np /tee /mt /XA:SH /XJ /XD AppData /log:backup_log.txt
My System SpecsSystem Spec
07 Aug 2012   #103
Golden

Microsoft Community Contributor Award Recipient

Windows 7 Ult. x64 Windows 8.1 x64
 
 

Hi and welcome to SevenForums,

Your backup script looks good - the only thing I would change is the "retry/time-out" option. If the user is using their laptop from home and is not connected to the network, and they then try run ROBOCOPY, it will by default attempt to reconnect up to 1 million times, with a 30 second wait time between reconnections - these are the default values.

A better option is to limit this to something like 3 retrys, with a 10 second wait time between each retry. In your example, it would look like this: (shown in red below)

r:3 = retry 3 times
w:10 = wait 10 seconds between each retry

Code:
 
robocopy c:\users\bgilbert2 \\servername\faculty\bgilbert2 /e /np /tee /mt /r:3 /w:10 /XA:SH /XJ /XD AppData /log:backup_log.txt
To answer your other questions:

1. If the laptop is offsite and ROBOCOPY runs, then YES, it will fail gracefully and quickly - limiting the retry options will ease that failure too.

2. If they close the window, then they also close the ROBOCOPY function, and that will also fail gracefully and quickly.

Regards,
Golden
My System SpecsSystem Spec
.


07 Aug 2012   #104
callbrady

Windows 7 Ultimate 32bit
 
 

Wonderful! Thanks. In testing today it seemed to work great. The only thing I noticed was that a hidden Recycler folder was getting Robocopied even though files with the 'hidden' attribute shouldn't go. Does Recycler have unique properties that need to be handled differently?
My System SpecsSystem Spec
07 Aug 2012   #105
Golden

Microsoft Community Contributor Award Recipient

Windows 7 Ult. x64 Windows 8.1 x64
 
 

Hi,

Mmm, I don't know to be perferfectly honest.......have you tried excluding that using wildcards?

XF = exclude file

/XF RECYCLER* or whatever the recycler is called?

Regards,
Golden
My System SpecsSystem Spec
11 Aug 2012   #106
jkitc

Windows 7 Home Premium x64
 
 
Robocopy.bat Does Not Work

I have created a Backup Script, but it does not work. I can copy that script and open a CMD window and paste it in and it executes and backs up. It looks like it is working, but it is in a loop.
How can I fix this?

Below is the content of: Robocopy.bat

robocopy B:\jkitc\Documents\Jarte G:\RobocopyBackups\Jarte /e /mir /np /log:backup_log.txt
pause
My System SpecsSystem Spec
11 Aug 2012   #107
Golden

Microsoft Community Contributor Award Recipient

Windows 7 Ult. x64 Windows 8.1 x64
 
 

Hi,

I don't see a problem with that script - what is in the backup_log.txt file?

Regards,
Golden
My System SpecsSystem Spec
12 Aug 2012   #108
jkitc

Windows 7 Home Premium x64
 
 

Nothing in the log file when I run the script in Robocopy.bat. If I run the script in a CMD prompt then the log file is full and tells the whole story. So apparently the script is fine, but something is preventing me from executing the batch file.
My System SpecsSystem Spec
12 Aug 2012   #109
Golden

Microsoft Community Contributor Award Recipient

Windows 7 Ult. x64 Windows 8.1 x64
 
 

Save the .BAT file to your desktop, then right-click on it and choose the 'Run as Administrator' option.

Regards,
Golden
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
Robocopy backup for personal folders Backup and Restore
I Need Help To Create REG. Script With Admin. Priv. For Reg. Editor? Customization
Anyone use robocopy to backup? Backup and Restore

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 07:46 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App