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

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 MVP

Windows 7 Ult. 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 MVP

Windows 7 Ult. 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 MVP

Windows 7 Ult. 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 MVP

Windows 7 Ult. 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
Windows 7 Tutorial Category
robocopy script is not working through Scheduler
Dear All, My batch file of robocopy is working fine. But when I tried to run it through task scheduler, none of the files transfer to the target location. @echo off echo +-----------------------------------------+ echo Database Export Utility for server ...
General Discussion
Robocopy Backup - ERROR 5 (0x00000005)
Hi, I'm wondering if anyone might be able to shed some light on why I am getting the following such errors when running a robocopy batch file (as administrator) which cause the backup script to stall (- albeit temporarily): I am using the following backup command: robocopy "%srcPath%\My...
Backup and Restore
How 2 create a script/BAT or something that changes my desktop image?
Okay so I just got this program called Transparent Screen Lock and you can run files when the program starts/locks and closes/unlocks. What I would like to do is create a script or something that changes my desktop background to an image when I click "lock" and another script to change the desktop...
Customization
Robocopy backup for personal folders
I have created a batch file for copying my Documents folder to an external hard drive: The log file shows that it is backing up C:\users\USERNAME\documents\My Music and C:\users\USERNAME\documents\My Pictures. That's fine, because I want those backed up anyway, but when I go to...
Backup and Restore
I Need Help To Create REG. Script With Admin. Priv. For Reg. Editor?
Hello. I have a technical question/issue I wish to ask. I hope someone can help me. I am looking help for someone to modify or rewrite for me a simple system registry script for my context menu that allows or forces to "run as administrator" privileges automatically when I click on the...
Customization
Anyone use robocopy to backup?
Evening all, Just curious to know if anyone uses the built in utility to backup software on your machine, im trying to backup my itunes folder to an external HD but having a few issues to get this to work properly! I also use sync toy for backing up but just really want to know what everyone...
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 16:44.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App