robocopy interview questions
Top robocopy frequently asked interview questions
robocopy /Z
= "copy files in restartable mode".
What does this option do? All the documentation I've found simply quotes the on-board manual. What is "restartable" mode, why would someone use it, and how does it differ from "Backup mode" (/B
) ?
Source: (StackOverflow)
I'm using robocopy to do backups with a PowerShell script, and it's pretty awesome, except that I'd like it to only show the progress percentage while it copies and not all of the other information.
The other information clutters the command window, which I'd clean and simple so that it's easy to see the overall progress of the backup.
Is this possible?
Thanks,
Andrew
Source: (StackOverflow)
I have the following folder structure:
FolderA
--Folder1
--Folder2
--Folder3
...
--Folder99
Folders 1 through 99 have files in them.
All I want to do is to copy ALL THE FILES into ONE FOLDER, basically do a FolderA copy, and wipe out Folders 1-99 keeping all the files.
I'd like to do it with Robocopy from cmd.exe if possible (Windows Server 2008)
Source: (StackOverflow)
Robocopy outputs 1 upon success, unlike most programs that exit with 0 on success. Visual Studio (and MSBUILD) interprets exit code of 1 as an error.
How can Robocopy be used in Visual Studio post- and pre-build events such that its failure and success are correctly identified by the build environment?
Note: this is more or less a repost of this post.
Source: (StackOverflow)
I have a simply windows batch command (robocopy) that returns zero errors but is always marked as a failure in Jenkins. I would like to know why?
D:\Jenkins\jobs\Jenkins Config Backup\workspace>exit 1
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE
Source: (StackOverflow)
As the title says, how can I recursively copy a directory structure but only include some files. E.g given the following directory structure:
folder1
folder2
folder3
data.zip
info.txt
abc.xyz
folder4
folder5
data.zip
somefile.exe
someotherfile.dll
The files data.zip and info.txt can appear everywhere in the directory structure. How can I copy the full directory structure, but only include files named data.zip and info.txt (all other files should be ignored)?
The resulting directory structure should look like this:
copy_of_folder1
folder2
folder3
data.zip
info.txt
folder4
folder5
data.zip
Source: (StackOverflow)
I need to copy files at a regular interval, eg once an hour so I tried setting up an xcopy batch saying it should copy the files it needs to copy to another folder. Now when it copies, it overwrites the files which is not what it is supposed to do.
When a file is copied, it should create a new file instead, named something like File.txt, File-COPY1.txt, File-COPY2.txt or something like that.
Any way to do that?
Thanks in advance.
Source: (StackOverflow)
I want to copy a directory(abc) from domain1/user1 to domain2/user1. any idea how to do this.
e.g robocopy
robocopy \\server1\G$\testdir\%3 \\server2\g$\uploads
and both are on different domains
Source: (StackOverflow)
Does anyone know if it is possible to download the latest robocopy for Windows 2003. The latest version provides the /DST option which ignores time stamps changed due to BST (British Summer Time). Every time we do a build and sync our servers when we go +1/-1 hour it takes hours instead of minutes because it sees everything as changed.
I noticed it is included automatically with Vista/Win7 but the Resource toolkit that I downloaded doesn't include a new version of robocopy for Win Server 2003. If there is a place to download it from & will it also work on Windows Server 2003?
Thanks.
Source: (StackOverflow)
does anyone know how to exclude .svn folders with Robocopy?
I want to copy all folders but I want to prevent to copy the subversion folders that svn creates.
Any ideas on this?
Thanks in advance.
Source: (StackOverflow)
Here is some code I made :)
@echo off
set source="R:\Contracts\"
set destination="R:\Contracts\Sites\"
ROBOCOPY %source% %destination% *.srt *.pdf *.mp4 *.jpg /COPYALL /R:0 /S
for /r %source in (*) do @copy "%destination" .
R:\Contracts\ is full of folders which have files in them.
I want to copy all to R:\Contracts\Sites\ and flatten the folder structure.
Everything copies well but also the folder structure.
Thank you
Source: (StackOverflow)
I am curious to know what makes Robocopy (Robust File Copy) so fast and robust. Any body knows what is the API/Algo used for Robocopy? Anybody studied Robocopy?
I am asking since I have to write a method (in .NET/C#) which will copy directories/files fast and without errors... The amount of data can go up to 15Gb and I cannot simply call Robocopy for various reasons.
Thanks!
Source: (StackOverflow)
How would you translate this xcopy command into Robocopy:
xcopy *.* "C:\DestinationFolder\"
Keeping in mind that the current folder where the command is run changes dynamically (and hence the source folder is unknown in advance).
Thanks.
Source: (StackOverflow)
Is there any way to exclude copying of empty files (0 bytes) using robocopy command?
I have a source with thousands of empty files besides other files and destination also have same file names but not empty. I want to copy everything from source to destination except empty files.
Source: (StackOverflow)