please give the command in Robocopy i should use to copy the files from primary server to the secondary server - robocopy

I got the command in robocopy as mentioned below
ROBOCOPY Source Destination [file…[file]…..] [Options]
Source: Source Directory
Destination: Destination Directory
Files: files to copy .
Please let us know what does the "\server\share\path" means? Kindly provide me an example on this command syntax and explain

An example of a ROBOCOPY call would be
ROBOCOPY C:\Users \\SERVER\backup\Users /MIR /R:0 /W:0
This copys everything under C:\Users to a network share at the UNC path \\SERVER\backup. If you don't know, what that means, google for 'UNC path' or find a nice tutorial that explains how to setup network shares under Windows.
Instead of \\SERVER\backup, that copies to a remote machine, you are totally free to use something like H:\ to copy to a local drive like a USB mass storage device.
The part /MIR /R:0 /W:0 are options of ROBOCOPY. Call ROBOCOPY /? to get an explanation for these.
Cheers,

Related

Run Robocopy in "Report Only" Mode

I have a fairly simple robocopy command here that I want to run that will upload files to an Azure storage account. The problem I have is I'm looking at approxiately 70,000 files but a lot of these already exist in the storage account.
What I want to do is run the command in a "Log Only" or "whatif" mode so I can see how many files will be copied and how many will be skipped. This command gives that detail but will perform the copy. Is there a switch I can add that will simply provide the log and NOT copy the files?
S:\inbound\ \\<storageaccount>\<filesharename>\inbound\ /r:3 /w:3 /e /xo /xx /LOG:Robocopy_20200313_Manual.txt
Yes, you may try the switch /L which means List Only but Will Not Copy any files or Change any attributes.

Using xcopy instead of robocopy for wildcarded files

I'm working on an old 2003 server and I want to copy a folder for specific files while also retaining the folder structure.
Note: I am not allowed to install or add robocopy onto this server.
The command that I use on another server is usually something like this.
robocopy Application Application_small *.txt /E
This, of course, gives me a new directory with nothing but the .txt files and the same folder structure.
But of course, robocopy isn't on Server 2003. However, xcopy does exist. Is there an equivalent switch that I can use to get the same kind of result as robocopy?
Similar question was found here.
xcopy Application\*.txt Application_small /s

Robocopy Access Denied Error 5 From Powershell

I am copying files from my build server to a web server on Windows Server 2016. I am running the following from PowerShell. I am running this script with an administer account which has read/write access to the destination directory.
robocopy $Path\Items $_\Items /Sec /copy:DT /MIR /NDL /NS /NP /MT /w:1 /r:1 /R:20 2>&1 | out-host
I get the following error
ERROR 5 (0x00000005) Creating Destination Directory
\SOMEPATH\Data\Items\ Access is denied.
Ensure that you open your powershell session as an administrator (runas)
Also check the NTFS permission on the destination path and not only the security permissions.
If you are using a DFS path you should be better with the UNC path of the actual servername.
Hope this helps.
Actually I was not able to post this as a comment under your question, because I don't have 50 rep points yet.

Robocopy - ERROR 124 (0x0000007C) Creating Destination Directory

Hoping someone familiar with Windows 10 and Robocopy can help.
I am using the following robocopy command in backup script that is being run as Administrator (yes the real Administrator user ID)
runas /user:Administrator backup.bat
robocopy N:\FNL E:\FNL /MIR /E /Z /R:1 /W:1 /V /NP /LOG+:backup.log
As long as there have been no new files for directories created in the source folder, in this case N:\FNL it seems to run fine. As soon as I create a directory, for example "Fred", I get the following error:
ERROR 124 (0x0000007C) Creating Destination Directory N:\FNL\Fred
The system call level is not correct.
I have changed file permission for "Authenticated Users" to Full Control and as well have taken ownership of all folders and sub-folders/child objects on the target drive but still get the same error.
Anyone have an idea what I might be doing wrong?

PowerShell to Robocopy exclude is not working

In PowerShell I am trying to copy files from one location to another and want some files to be excluded. so I am using the following commands:
$Excludefiles="`"$((get-content 'C:\WorkingDirectory\List.txt') -join'""')`""
robocopy "C:\aa\" "C:bb\" /XF $Excludefiles
It seems it is excluding everything.
Please share your thoughts.