robocopy is giving unequal number of directories but same number of files? - robocopy

When running robocopy I am experiencing the following. Can you correct/explain what is happening, please?
I get an extra directory under the total column and 1 skipped directory. Yet the number of files in total and copied columns are the same?. Note the number of bytes is also the same.
One of my directories appears to copy all but hangs up in some kind of a loop necessitating a restart of robocopy. I am never confident that the copy is ok. How can I identify the problem?
Options listed in the log are different than those specified.
robocopy "E:\mmarion.4" "D:\mmarion.4" /E /256 /NC /NFL /NS /NDL /NP /TEE
becomes
Options : *.* /256 /NS /NC /NDL /NFL /TEE /S /E /DCOPY:DA /COPY:DAT /NP /R:1000000 /W:30
Thank you. MM

For part 3: Even if you don't specify some options, the output tells you which options are getting applied. In the case you quoted, the following are defaults, so they appear in the output even though you didn't include them in your command.
/DCOPY:DA
/COPY:DAT
/R:1000000
/W:30
The other odd one is /S. You specified /E, and Robocopy reports both /E and /S when you do that. That's technically a bit misleading, because /S means "... but not empty ones", and /E means "... including empty ones", so it can't really be both at the same time. But if you think of /S as meaning "... non-empty subdirectories" and /E meaning "... both empty and non-empty subdirectories", then having /E expanded to both /S and /E is not unreasonable.

Related

Robocopy log differentiate copy from update

I had THOUGHT that RoboCopy logs could show the action for individual files, i.e. differentiate between a file copied new because it didn't exist in the destination vs file updated because it does exist but is different. But the last time I worked with RoboCopy was Windows 7, and now in Windows 10 I am not seeing anything that looks like a way to get that information in the logs. Am I misremembering, and that was never an option? Or did that functionality get removed? Or am I just missing the argument to make that happen?
FWIW, this is my argument string at the moment
RoboCopy $sourceFolder $destinationFolder /mir /mt /fft /copy:dat /r:10 /w:5 /log:$mirrorLogPath /njh /ns /nc /np

Robocopy: echo nothing when logging file

I am using Robocopy to write to log files:
robocopy "C:\source" "E:\destination" /e /l /njs /njh /log:C:\folder1\reconcile1.txt
When I use this in my batch file the console shows: Log File : C:\folder1\reconsile1.txt
I do no want anything echoed from this command. Is there a way to keep this away from appearing on the console?
You could redirect all output to nul:
robocopy "C:\source" "E:\destination" /e /l /njs /njh /log:C:\folder1\reconcile1.txt > nul

Robocopy logfile (not showing missed/failed files)

I'm having trouble getting this to work properly, I'm trying to copy every file from an external HDD to my NAS device, and i only wanted to see in the logfile what are the files that have been skipped or not copied, this is what i used after reading on the forums:
Robocopy E:\ "\\NAS" /e /v /nfl /ndl /njh /njs /ns /nc /np /log+:"C:\Users\xx\Desktop\log.txt"
For some reason, it doesn't save anything to the logfile when it's done, completely empty. Yet when i check the file and folder properties of both HDD and the Backup folder it shows that there are over 50,000 files that have NOT been copied.

Robocopy Only Output Copied Files

I have the following Robocopy command. Currently it outputs all directories it is traversing during the mirror but I only want it to output what actually got synced from source to destination. I'm not seeing a "only show differences" option in the documentation.
robocopy "C:\inetpub\example.com" "Z:\D Drive\Projects\example.com\Web\example.Web" /mir /xd "C:\inetpub\example.com\wp-content\mu-plugins\example-network" "C:\inetpub\example.com\wp-
content\plugins\example" "C:\inetpub\example.com\wp-content\themes\example" ".git"
Of course I figured it out right after I posted the question. Here is my new command. The /fp /ns /ndl options did the trick.
robocopy "C:\inetpub\example.com" "Z:\D Drive\Projects\example.com\Web\example.Web" /mir /fp /ns /ndl /xd "C:\inetpub\example.com\wp-content\mu-plugins\example-network" "C:\inetpub\example.com\wp-content\plugins\example" "C:\inetpub\example.com\wp-content\themes\example" ".git"
Meaning of switches
From SS64 entry:
/FP : Include Full Pathname of files in the output.
[...]
/NS : No Size - don’t log file sizes.
[...]
/NDL : No Directory List - don’t log directory names.

Robocopy for long paths with /mir switch changed destination to root and nuked machine

My purpose was to copy files with long paths (+255 char) and spaces in the folder path from a computer to a server with an analogus folder already in place (needed to maintain folder structure). Below is an example of the script:
robocopy "c:\long path\with spaces" "\\servername\long path\with spaces" filename.html /MIR /R:5 /LOG+:\\server\logfolder /v /NP
The result was the below log and a complete deletion of the source machine. Any thoughts?
Source : c:\long path\with spaces
Dest : \
Files : filename.html
Options : /V /S /E /PURGE /MIR /NP /R:5 /W:30
I've been researching and have found no other situation. I'd absolutely love to avoid this issue in the future.
unfortunately, robocopy is going to see the "\\" as an escape sequence, and you end up with a path that's just \. you need to use /"\servername\long path\with spaces\/" for quoted UNC paths.