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

11 Oct 2015   #250
d95gas

Windows 7 Enterprise 64 bits
 
 

Just spent the best part of this afternoon reading all 25 pages of this fantastic post. What an awesome guy "Golden" is and the patience of a saint.

Anyway onto the question. I need to do some replication of data on a NAS drive, to an external USB drive hanging off a PC, so traffic is across the network after hours.

I need to ensure the explicit copy of all permissions and security elements so that in the event we need to recover from the External to the NAS, all permissions are in place and cuts down on our workload.

So basically copying from mapped drive H:\Users to mapped drive Q:\users

what would be the best script to use to ensure I get all security permissions ?

when the batch files run, there will be no other network traffic at all, and all files on other workstations will be closed down.

In addition. Is there anyway I can run RoboCopy to just transfer the permissions from the source to the destination where files already exist.

Previously I used RichCopy, to find out, that despite having all the advanced settings turned on, it didn't copy the permissions as it should.

thanks


My System SpecsSystem Spec
.
11 Oct 2015   #251
Golden
Microsoft MVP

Windows 7 Ult. x64
 
 

Thanks for the compliments.

Please try a test using this flag:

Code:
 /COPY:DATSOU
My System SpecsSystem Spec
12 Oct 2015   #252
satishsivadas

Windows 7 Professional 64
 
 

I need a backup solution - i need to write a startup script to be inserted in our company laptops such that when a laptop connects to our network and detects our backup server, it should automatically start to backup data that are new or is there any free software available so that i can install as a backup and restore solution
My System SpecsSystem Spec
16 Oct 2015   #253
pplucky

Windows 10 Pro x64
 
 

Hello.

I have been using Robocopy successfully for some time now, in a batch script in Windows 7 to copy files from a local file to a network mapped drive folder. A couple of weeks ago, I tried to use the same exact script (and Robocopy file version btw) in a Windows 10 machine and couldn't.

This is basically my current command (variable %logfile% is dynamically filled before):
@robocopy "D:\Backup" "Y:\Backup" /MIR /ZB /R:5 /V /FP /UNILOG:"%logfile%" /NP>nul

which yields the following log file:
-------------------------------------------------------------------------------
ROBOCOPY :: Robust File Copy for Windows
-------------------------------------------------------------------------------

Started : friday, 16th of October 2015 16:17:38
2015/10/16 16:17:38 ERROR 3 (0x00000003) Getting File System Type of Destination Y:\Backup\
The system cannot find the path specified.


Source : D:\Backup\
Dest - Y:\Backup\

Files : *.*

Options : *.* /V /FP /S /E /DCOPY:DA /COPY:DAT /PURGE /MIR /ZB /NP /R:5 /W:30

------------------------------------------------------------------------------

2015/10/16 16:17:38 ERROR 3 (0x00000003) Creating Destination Directory Y:\Backup\
The system cannot find the path specified.

I've read somewhere that this might be an bug in Windows 10, as the following command also fails all the time from the batch file:
if NOT exist "Y:\Backup" goto:message2

Can anyone provide any tips on how to overcome this error in robocopy (and how to check if a certain folder exists in a mapped network drive, in Windows 10 via batch file)?
My System SpecsSystem Spec
.

16 Oct 2015   #254
Golden
Microsoft MVP

Windows 7 Ult. x64
 
 

In Windows Explorer, is Y: the mapped network drive?
My System SpecsSystem Spec
17 Oct 2015   #255
pplucky

Windows 10 Pro x64
 
 

Quote   Quote: Originally Posted by Golden View Post
In Windows Explorer, is Y: the mapped network drive?

Yes, for sure.

If I use the command prompt rather than the script, it actually works properly :s
My System SpecsSystem Spec
01 Nov 2015   #256
nCogNeato

Windows 7 Home Premium 64-bit
 
 

Quote   Quote: Originally Posted by pplucky View Post
Quote   Quote: Originally Posted by Golden View Post
In Windows Explorer, is Y: the mapped network drive?

Yes, for sure.

If I use the command prompt rather than the script, it actually works properly :s
Is the script running as Administrator?

For some reason, Robocopy behaves better when ran as user instead of Administrator. "Error 3" plagued me for some time before I realized.
My System SpecsSystem Spec
13 Dec 2015   #257
platy

WA
 
 

I also supply /XJ (to prevent following junctions) and /B to acquire backup restore privilege. The latter ensures you will not run into ACL issues but you need to run the script elevated. Also I never use /MIR - because /MIR will delete files that have been deleted on the source drive. With MIR you can potentially lose data when say some files are missing in the source drive.
My System SpecsSystem Spec
13 Dec 2015   #258
pplucky

Windows 10 Pro x64
 
 

Fixed by NOT running the script as Administrator (as I used to do in Windows 7 without issues) and also change /ZB to /Z as the backup mode.

Now all works well and is back to normal.
My System SpecsSystem Spec
02 Feb 2016   #259
duceduc

Windows 7 64bit
 
 

I have been using robocopy with success mirror copying folders from different locations and drives. However, I am having difficulty backing up a drive from an old Trition 250 unit nas.

Robocopy always add 3 backslashes.

Here is my input
'robocopy \\jcbnas\disk1 C:\disk1'

Robocopy trys to scan the nas with '\\jcbnas\disk1\\\' which is an invalid path.

I have tried different ways of add the line source path with quotes, with and without backslash. Changed the network name. Created a network drive with a letter and tried to connect with it. Using the network ip address rather its name. It always add 3 backslashes during scan.

I am able to copy using unc path from a hdd that is connected from a pc with no issue. It is just this NAS I have trouble with.
My System SpecsSystem Spec
Comment

 ROBOCOPY - Create Backup Script




Tutorial Tools Search this Tutorial
Search this Tutorial:

Advanced Search




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 17:16.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App