Questions tagged [robocopy]
Robocopy (or "Robust File Copy") is a command-line directory replication command.
506
questions
150
votes
12
answers
131k
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 ...
134
votes
2
answers
176k
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 ...
90
votes
6
answers
381k
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 ...
46
votes
3
answers
96k
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 ...
46
votes
15
answers
161k
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 ...
45
votes
6
answers
46k
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\...
45
votes
2
answers
211k
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 ...
43
votes
5
answers
125k
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?
41
votes
2
answers
176k
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 ...
35
votes
3
answers
142k
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.
34
votes
4
answers
71k
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 ...
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 ...
29
votes
3
answers
47k
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 ...
29
votes
3
answers
175k
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 ...
27
votes
4
answers
159k
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 ...
26
votes
2
answers
57k
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" /...
23
votes
4
answers
46k
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:"$...
20
votes
2
answers
14k
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 ...
19
votes
7
answers
39k
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 ...
15
votes
4
answers
214k
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\...
15
votes
1
answer
16k
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 ...
13
votes
4
answers
37k
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 ...
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 ...
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 ...
12
votes
1
answer
50k
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 ...
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 ...
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 ...
10
votes
4
answers
160k
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 ...
10
votes
1
answer
46k
views
Robocopy, how to log only errors?
Will the options /nfl /ndl be enough and not exclude errors too?
10
votes
2
answers
33k
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 ...
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 ...
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 &...
9
votes
2
answers
56k
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. ...
9
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 ...
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 ...
9
votes
3
answers
26k
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 ...
9
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 ...
8
votes
4
answers
70k
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 "...
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 ...
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
...
8
votes
1
answer
23k
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 ...
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 ...
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 ...
7
votes
4
answers
26k
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 ...
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\...
6
votes
1
answer
20k
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?
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 ...
6
votes
2
answers
15k
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 ...
6
votes
2
answers
4k
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 ...
6
votes
1
answer
12k
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.