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?
Related
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.
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.
I've been cracking my head trying to fix this. But it seems this command line isn't working for my robocopy batch file. It has something to do with the parameters, quotation marks, backslashes or maybe I'm just blind. I'm not too sure. Here's the code.
REM #Echo Off
SETLOCAL EnableDelayedExpansion
Set hostname=%COMPUTERNAME%
set torun=wmic bios get serialnumber /format:value
for /f "tokens=2 delims==" %%a in ('%torun%') do set serial=%%a
Set src="D:\BackUPTEST\%serial%"
set dest="D:\RestoreTEST\%serial%"
set logdest="D:\RestoreTEST\%serial%\Logs"
set logfile=Restore-%serial%.log
set log="%logdest%\%logfile%"
robocopy %src% %dest% /E /R:3 /W:3 /TEE /log:%log% /NP
echo Restore Completed. . .
ENDLOCAL
Echo On
I'm returned with...
ERROR : Invalid Parameter #7 :
"/log:D:\RestoreTEST\CNU1293K2J\Logs\Restore-CNU1293K2J.log"
Simple Usage :: ROBOCOPY source destination /MIR
source :: Source Directory (drive:\path or \\server\share\path).
destination :: Destination Dir (drive:\path or \\server\share\path).
/MIR :: Mirror a complete directory tree.
For more usage information run ROBOCOPY /?
**** /MIR can DELETE files as well as copy them !
Just been hit by the dreaded "Invalid log parameter"!
Been using it for a year or more without problem, running on a network drive, then Robocopy V10 hit my machine a few days ago and it stopped working with the following message:
'\\SEAGATE-435DC3\usb1-1share1\BACKUP'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
C:\Windows>robocopy X:\Documents Y:\BACKUP\Documents /s /XO /FFT /DST /TEE /NP /R:2 /W:5 /LOG:robocopy_docs.log
2016/11/10 19:07:47 ERROR 5 (0x00000005) Opening Log File C:\Windows\robocopy_docs.log
Access is denied.
So you now need to specify the path to the log file, then it works!
(Y: is mapped to \SEAGATE-435DC3\usb1-1share1)
Okay, figured out. As for Logging, there should be an existing Folder. So I simply added mkdir %logdest% before the robocopy command initializes... That seems to fix it.
This command works:
robocopy \\build7\d$ d: *.* /mir /XD "System Volume Information" /XD "$Recycle.Bin"
But when I try adding the /MT flag:
robocopy \\build7\d$ d: *.* /mir /XD "System Volume Information" /XD "$Recycle.Bin" /MT
The only output I get is
-------------------------------------------------------------------------------
ROBOCOPY :: Robust File Copy for Windows
-------------------------------------------------------------------------------
Started : Thu Apr 09 09:11:27 2015
Source : \\build7\d$\
Dest : D:\
Files : *.*
Exc Dirs : System Volume Information
$Recycle.Bin
Options : *.* /S /E /COPY:DAT /PURGE /MIR /MT:8 /R:1000000 /W:30
------------------------------------------------------------------------------
It gives me that output, and then just sits there.
I tried using the /LOG flag to redirect the output to a file, but it still just sat there with the same output, only in a file.
Is it doing something in the background that I can't see, or am I doing something wrong?
In my experience, what you are seeing is normal. When Robocopy runs using multiple threads (/MT), the output is limited to exceptions (new file, extra dir, error, etc...). It will not show you the directory names with the file count that you are probably used to seeing. That means that if the target is largely in-sync with the source, you will not see much output.
I don't know exactly why this is the case. I assume that Robocopy handles the directory walking differently when there are multiple threads involved. This difference probably makes the normal output impossible (or meaningless) to produce.
When I am running Robocopy with multiple threads, I often use the Disk tab in the Windows Resource Monitor to see what Robocopy is doing. How to Use Resource Monitor
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,