Questions tagged [robocopy]

Robocopy (or "Robust File Copy") is a command-line directory replication command.

Filter by
Sorted by
Tagged with
150 votes
12 answers
130k views

Getting ROBOCOPY to return a "proper" exit code?

Is it possible to ask ROBOCOPY to exit with an exit code that indicates success or failure? I am using ROBOCOPY as part of my TeamCity build configurations, and having to add a step to just silence ...
Lasse V. Karlsen's user avatar
134 votes
2 answers
174k views

What does Robocopy mean by tweaked, lonely, and extra?

The Robocopy documentation for the option /it is simply “Includes ‘tweaked’ files”. What does “tweaked” mean? The Robocopy documentation for the option /xl is simply “Excludes ‘lonely’ files and ...
sean e's user avatar
  • 2,761
91 votes
6 answers
372k views

Using robocopy and excluding multiple directories

I'm trying to copy some directories from a server before I restore from backup (my latest backup was corrupt, so I have to use an older one :( ). I'm in the Windows Recovery Environment and have ...
GorrillaMcD's user avatar
  • 2,423
46 votes
3 answers
94k views

Linux equivalent to robocopy?

It’s kind of funny, there are a lot of ways in which Linux command line tools are vastly superior to Windows ones, but one thing I have not found an equivalent to is robocopy. Robocopy is way more ...
Ibrahim's user avatar
  • 803
46 votes
15 answers
157k views

Why can't a Task Scheduler job access a mapped network drive?

I have a Task Scheduler job to run Robocopy for backing up local files to a network share. I have to use domain credentials to access the network share but the local computer is not on the domain, and ...
Craig W's user avatar
  • 761
45 votes
6 answers
44k views

Will robocopy resume after being aborted?

My users directory is 58 GB in size and I am copying it to a portable USB backup drive from Windows recovery using Robocopy. robocopy G:\Users\ E:\Backup\T420\ /MIR /SEC /MT:32 /V /LOG:G:\bak\...
opticyclic's user avatar
  • 1,559
44 votes
2 answers
207k views

ROBOCOPY command to do an incremental backup

I am overwhelmed by the ROBOCOPY documentation. I want to do an incremental backup of my local files to the network drive (M). I want it to run as quickly as possible, with no log file and with as ...
dmm's user avatar
  • 581
43 votes
5 answers
123k views

What is the benefit of copy over xcopy on the command line?

I know that xcopy has more options however are there any benefits to using copy rather than xcopy?
Phil Hannent's user avatar
  • 1,142
39 votes
2 answers
174k views

How to copy ONLY those files that are not in the destination?

Is it possible to use robocopy to copy only the files that do not exist in destination? robocopy has a /is (include same files) switch. What I am looking for is an /xs switch. If a file exists in ...
yky's user avatar
  • 391
35 votes
3 answers
135k views

Does Robocopy SKIP copying existing files by default?

I've read (somewhere) that Robocopy skips copying over existing files by default. But... I can't find any Command Line switches for that.
Clay Nichols's user avatar
  • 5,306
34 votes
4 answers
69k views

What is backup mode in Robocopy

I am trying to copy a large database backup file over network. The traditional program copy or xcopy failed with different binary resulted. Also tried robocopy without parameter, and resulted a ...
ydoow's user avatar
  • 483
29 votes
2 answers
35k views

How does Robocopy determine if a file is "changed"?

I'm looking here for detailed info about how the algorithm of Robocopy determines whether a file has changed or not. If I use for example the /mir parameter, Robocopy must determine which files are ...
user54512's user avatar
  • 835
29 votes
3 answers
172k views

How to copy only new files AND only those that are modified after a certain date?

I would like to copy files from one drive to another, but I only want to copy source files that are newer than the destination file. BUT, I also want to only copy source files that have been changed ...
PaulStock's user avatar
  • 453
27 votes
4 answers
149k views

Robocopy - Copy directory into another directory

I can't believe that I am having trouble in copying a directory into another directory via the windows command line. What I want to do is simple -: Lets say I have a directory -: C:\test and I ...
ng.newbie's user avatar
  • 499
27 votes
3 answers
46k views

Are there any Pros/Cons to the /j Robocopy option (unbuffered copying)

Robocopy has a /J command line option recommended for copying large files (it copies using unbuffered I/O). What (if any) downsides are there? Any reason this isn't enabled by default? (That's what ...
Clay Nichols's user avatar
  • 5,306
26 votes
2 answers
56k views

Robocopy /XD Won't Work With Relative Paths

I am trying to run a robocopy /MOVE command but exclude a couple of sub-directories specified with the /XD flag. robocopy ".\CurrentDir" ".\NewDir" /XD ".\CurrentDir\SubDir1" ".\CurrentDir\SubDir2" /...
user8783's user avatar
  • 545
23 votes
4 answers
45k views

How do I hide "Extra File" and "100%" lines from robocopy output?

I have a robocopy script to back up our Kiln repositories that runs nightly, which looks something like this: robocopy "$liveRepoLocation" "$cloneRepoLocation" /MIR /MT /W:3 /R:100 /LOG:"$...
Danny Tuppeny's user avatar
19 votes
7 answers
38k views

How to copy a directory on Windows, preserving timestamps of all directories being copied

I want to copy a directory tree while preserving timestamps of any file and directory contained therein being copied. The source directory is on a data DVD (ISO-9660 filesystem). I am copying to an ...
Armen Michaeli's user avatar
18 votes
2 answers
13k views

What does "robocopy /NOOFFLOAD" do?

The windows tool robocopy has a command line switch /NOOFFLOAD. What does this switch actually do, and under what circumstances would I use it? The documentation for the switch says /NOOFFLOAD :: copy ...
HugoRune's user avatar
  • 728
15 votes
4 answers
209k views

Robocopy to copy only new folders and files

Objective: To find all new files and subfolders under some root folder (let us say Documents) and to copy them to another disk (J: in this case). Command line used: robocopy c:\users\valery\...
Valery Shampal's user avatar
14 votes
1 answer
15k views

Syncing between C drive and phone with robocopy

I'm on Windows 10 and trying to sync my music folder with the one on my LG G5. My plan is to use robocopy /mir, but I don't know how to write out a path to the directory on my phone. The phone's set ...
user2752467's user avatar
13 votes
4 answers
36k views

Can Robocopy monitor files on a time increment of less than one minute?

Robocopy has the option to monitor the source directory, and copy over any files that have changes. You can specify how many changes in the directory must occur before copying (/mon n where n is the ...
nhinkle's user avatar
  • 37.4k
13 votes
11 answers
35k views

Robocopy does not copy the root folder and its time stamp

Robocopy does not copy the root folder and its time stamp - it copies all subdirectories and files (when the appropriate options are set) and there seems to be no option/argument to tell Robocopy you ...
ptrcao's user avatar
  • 173
12 votes
5 answers
111k views

Robocopy permission denied

Robocopy is preinstalled with Windows 7. I've used it many times in the past. I tried to copy a folder to a remote share with robocopy c:\source "\\server\share\path" /s /r:2 /w:2` As a result I ...
Edosoft's user avatar
  • 810
12 votes
1 answer
46k views

How to speed up robocopy

I'm working with a Windows-7 computer, who needs to copy a lot of small files from the network (NAS). I used to do this using xcopy command, but due to a file lock problem, I've decided to start ...
Dominique's user avatar
  • 2,193
12 votes
7 answers
22k views

Robocopy unilog output is gibberish

I tried to get robocopy in Windows 7 to generate a Unicode log, since I have files with Unicode characters. The command I used: robocopy C:\mysource D:\mydest /mir /unilog:backup.log /tee File the ...
miro's user avatar
  • 121
11 votes
2 answers
55k views

How to robocopy with progress logged to console only?

I want to run RoboCopy that will update the console with % progress but not clutter the log file with % progress. The following RoboCopy command will perform the desired copy and append logging ...
Tim Murphy's user avatar
10 votes
4 answers
154k views

How do I create a log of robocopy actions and save in a text file named with today's date?

I am copying some assets from one folder to another using robocopy in command prompt. However, I want to log name of all those copied assets in a .txt file. This .txt file should be saved in the form ...
Yash Saraiya's user avatar
10 votes
1 answer
44k views

Robocopy, how to log only errors?

Will the options /nfl /ndl be enough and not exclude errors too?
mt22's user avatar
  • 245
9 votes
3 answers
14k views

delete recursive directory created by robocopy when "The file name is too long"

After running robocopy.exe to backup a C:\Users\ folder without using the /xj switch, I ended up with a recursive directory which was too long. For example, if you run dir /b /s you will receive the ...
Aaron's user avatar
  • 1,054
9 votes
2 answers
2k views

Using robocopy on windows led to infinite subfolder duplication via a stray shortcut file.... How can I avoid this?

I ran robocopy on my system (with all apps I could close, closed) and tried to rip the entirety of my C drive to a different drive. Im not sure why but, there was a systemlink in the C drive called &...
Mister SirCode's user avatar
9 votes
2 answers
55k views

Enable Robocopy logs

I have a robocopy job that is controlled by Windows Task Scheduler to run every 15 minutes to move files from one server to another. According to Windows Task Scheduler, the job is running fine. ...
mikebmassey's user avatar
9 votes
4 answers
68k views

Robocopy: show skipped files and files with an error while copying

I'm using the following command for copying files while preserving timestamps: robocopy [source] [destination] /E /ZB /COPY:DAT /DCOPY:T /R:1 /W:5 /V /NFL /NDL /NS /NC /NP /log:"[log-path]" /XD "...
testing's user avatar
  • 879
9 votes
4 answers
6k views

Copy Files from One Drive to Another and Keep Hard-Link in Windows

I have drive A: with 16G Space and plenty of files, due to the Hard-link feature in NTFS, the files together is 15G but only takes 2G of real space. I like to copy all those files to drive B: which ...
Eric Yin's user avatar
  • 369
9 votes
2 answers
31k views

Not able to access path of mobile phone in cmd

I'm kind of new at CMD so please go easy on me. I am trying to copy files from my mobile phone via robocopy in CMD as the regular copy/paste doesn't support some of the features of robocopy I'd like ...
DisplayNerd's user avatar
9 votes
3 answers
25k views

Robocopy not copying files in subdirectories

I am having problems with robocopy for whatever reason. I have several scripts I use daily that utilize copy, xcopy, and robocopy, and they are all working currently, except for this one. I am using ...
InterLinked's user avatar
  • 2,496
8 votes
5 answers
67k views

Access denied, cmd move windows 7

I can't use this command in win 7 when want to move a directory if the destination exists. It says Access denied. Why hapens this? It worked in XP. move /y "%1" c:\mydir\ I can use robocopy, but ...
Aziz's user avatar
  • 597
8 votes
1 answer
9k views

Use robocopy to mirror source but ignore timestamp

I want to backup a folder to a share on a linux nas with robocopy. I use the commandline robocopy /mir <source> <dest> After a succesfull copy in explorer the timestamps are equal but ...
Jürgen Steinblock's user avatar
8 votes
2 answers
8k views

Windows 7 Delete heavily nested folder structure [duplicate]

I was running a node script that went awry and created a folder structure like so: \myfolder \myfolder \file.txt \myfolder \file.txt \myfolder ...
Aristides's user avatar
  • 195
8 votes
1 answer
22k views

Robocopy Log File Meaning of New File, New Dir

I've been learning and using robocopy a lot for the last few weeks. One thing I have not been able to find is good documentation on the terms used in the default log file. There is no header row in ...
BitBug's user avatar
  • 275
8 votes
3 answers
29k views

Use OneDrive as additional backup location

I'm trying to take advantage of the fact that OneDrive now offers unlimited space, and allows these files to not take up space locally. I already have a backup system in place, but I would like to add ...
Jason Young's user avatar
8 votes
0 answers
1k views

How to make robocopy delete excluded files in destination directory

I have a cross-platform build toolchain which copies some folders to destination. I use robocopy on Windows and rsync on macOS because they support console progress output. The commands were in this ...
dmitry1100's user avatar
7 votes
5 answers
7k views

How can I copy files from A to B, only including files that exist in B?

I'm on Windows 7 Professional, and this is my scenario : Folder "Asd" (C:\) Folder "Asd" (D:\) File 1 File 1 File 2 File 3 File 3 ...
markzzz's user avatar
  • 747
7 votes
4 answers
25k views

Mirror/Backup from SSH/SFTP to Windows

What I am trying to do is mirror a directory (recursively) from a server I can SSH/SFTP to, to a Windows machine. I want to do this as part of a script, so it can be automated. I only want to copy ...
Andrew Russell's user avatar
7 votes
0 answers
5k views

Robocopy loops/nests "Application Data" 29 times when copying "Application Data" folder on Windows 10

My goal here is to be able to back up my entire computer by using robocopy. My robocopy script keeps getting stuck here as you can see with the Application Data. C:\Documents and Settings\All Users\...
CreativiTimothy's user avatar
6 votes
1 answer
18k views

How does Robocopy handle file system links (symbolic links, hard links and junctions)?

Is it safe to delete a Robocopy backup? I have read that some people accidentally deleted files outside of the backup because it contained links/junctions. Can I prevent this?
Marco Eckstein's user avatar
6 votes
2 answers
10k views

How to copy user's appdata folder using robocopy?

I'm trying to backup my current user's AppData folder. Because the folder is quite big, I wanted to use robocopy. However, robocopy is having mess with symbolics links. Especially, in the user ...
Steve B's user avatar
  • 2,212
6 votes
2 answers
14k views

Log only changes in robocopy output

I can't find a way to log only the changes in the output of a robocopy execution, i.e.: those considered new file, new directory, newer file, extra file, or extra directory. The default output as I ...
AndJM's user avatar
  • 265
6 votes
2 answers
3k views

How to wake a network drive from batch script?

I have a batch script which runs a robocopy. It is failing because the drive is not awake. In windows explorer, doubling clicking on that icon "wakes" up the link and the cross disappears and the ...
Valamas's user avatar
  • 1,545
6 votes
1 answer
11k views

ROBOCOPY /XN: newer in source or destination?

Does ROBOCOPY /XN exclude files that are newer in the SOURCE or files that are newer in the destination? I checked Microsoft official documentation but it is totally ambiguous.
Yván Ecarri's user avatar

1
2 3 4 5
11