Jump to content

Recommended Posts

Posted
We have just migrated all data to a new server and we just want to check the log files over however we have transfered across nearly 1000 users but we only want to see which users have failed to copy files. Is there anyway to get the relevant data from the log file?
Posted

When you do a robocopy there are a few columns of data, copied, skipped, failed. So for every copy job your going to find the word failed.

 

try starting robocopy from powershell and allowing it to pass the exit code back, then write that to a log file.

Here is a reference on exit codes

https://blogs.technet.microsoft.com/deploymentguys/2008/06/16/robocopy-exit-codes/

 

barring that, I think the most common errors are time out and accessed denied so try searching on those terms.

I'm sure there is a powershell equivalent, but also try running them through grep on a linux box.

cat log.txt | grep denied

 

ah looks like select-string

https://communary.net/2014/11/10/grep-the-powershell-way/

Posted
Search failed? Do you mean that it didn't find the word 'error'? Maybe there are no errors?

Sorry rushed my response. On the log file under each user it says failed and then 0 if no errors happen or if it has failed it will give us a number. I just want a way of searching for failed ones.

Posted (edited)

Doing this will find any results that have had more than 0 error's

 

If you try this in notepad++ versions 6 or higher (without the quotes): "^failed (?!.*0).*$"

The red is the word that it is looking forAnd the orange is what it is excluding

Below is an example of how i tested it, make sure that you set the search mode to "regular expression" or it will not work!

Capture.PNG

Edited by ewanc1234
Posted
Sorry rushed my response. On the log file under each user it says failed and then 0 if no errors happen or if it has failed it will give us a number. I just want a way of searching for failed ones.

:doh: sorry I get it now :s

 

So, it appears that you searched the word 'failed' but as above, it would be better to search the word 'error' to find every line with an error code.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...