Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Wednesday, June 1, 2016 8:40 AM | 1 vote
Hey guys, sorry if this isn't the place to post this I was unsure where else it could go.
So I have another Robocopy script going that mirrors between two directories, and I want to make
it write the changes that occur to a log file at same time?
I know that it will involve /FP as i want to know the full path name. But after looking online I can't find out
how to make RoboCopy to actually create the text document, only overwrite/append to one. And also i'm
unsure on the actually command to make it get the changes and write them.
Any help would be greatly appreciated, thanks in advance.
All replies (6)
Wednesday, June 1, 2016 5:19 PM ✅Answered | 1 vote
Well the /LOG is what you require, /FP logs the full path of the files it copies not to do with logging. If with /LOG I use a file name that does not exist it creates it.
So to create a unique filename each time we could create a variable based on the date time with a bit of string editing to make filename friendly date time.
set filedate=%Date:~-4,4%-%Date:~-7,2%-%Date:~-10,2%_%Time:~0,2%-%Time:~3,2%
robocopy c:\source d:\detination -e -log:"d:\results\filedate% robolog.txt"
Monday, June 6, 2016 7:52 AM ✅Answered | 2 votes
Flanelman,
Take a look at hte logging options in the article below:
https://technet.microsoft.com/en-us/library/cc733145(v=ws.11).aspx
Logging Options :
/L :: List only - don't copy, timestamp or delete any files.
/X :: report all eXtra files, not just those selected.
/V :: produce Verbose output, showing skipped files.
/TS :: include source file Time Stamps in the output.
/FP :: include Full Pathname of files in the output.
/BYTES :: Print sizes as bytes.
/NS :: No Size - don't log file sizes.
/NC :: No Class - don't log file classes.
/NFL :: No File List - don't log file names.
/NDL :: No Directory List - don't log directory names.
/NP :: No Progress - don't display percentage copied.
/ETA :: show Estimated Time of Arrival of copied files.
/LOG:file :: output status to LOG file (overwrite existing log).
/LOG+:file :: output status to LOG file (append to existing log).
/UNILOG:file :: output status to LOG file as UNICODE (overwrite existing log).
/UNILOG+:file :: output status to LOG file as UNICODE (append to existing log).
/TEE :: output to console window, as well as the log file.
/NJH :: No Job Header.
/NJS :: No Job Summary.
/UNICODE :: output status as UNICODE.
Follow the instruction and choose the switch you would like to apply.
Regards
Please mark the reply as an answer if you find it is helpful.
If you have feedback for TechNet Support, contact [email protected]
Friday, June 3, 2016 1:46 AM | 1 vote
Flanelman,
Any update here?
If any further help needed, please post back.
Regards
Please mark the reply as an answer if you find it is helpful.
If you have feedback for TechNet Support, contact [email protected]
Monday, June 6, 2016 3:02 AM | 1 vote
Well the /LOG is what you require, /FP logs the full path of the files it copies not to do with logging. If with /LOG I use a file name that does not exist it creates it.
So to create a unique filename each time we could create a variable based on the date time with a bit of string editing to make filename friendly date time.
set filedate=%Date:~-4,4%-%Date:~-7,2%-%Date:~-10,2%_%Time:~0,2%-%Time:~3,2%
robocopy c:\source d:\detination -e -log:"d:\results\filedate% robolog.txt"
This was exactly what I needed! Thanks! :)
Monday, June 6, 2016 3:12 AM | 1 vote
Flanelman,
Any update here?
If any further help needed, please post back.
Regards
Please mark the reply as an answer if you find it is helpful.
If you have feedback for TechNet Support, contact [email protected]
I have just ran into another issue, when i made the Logfile (successfully) it has data in there that I don't want.
So it tells me all of the moved/copied/deleted files between two directories that i'm mirroring, but it also updates me of the time, speed and total number of files/directories created etc which i don't want, i only want to know which files were copied or created. do you know how to alter it to do that?
Thanks again! :)
Tuesday, June 7, 2016 1:05 AM
Flanelman,
Take a look at hte logging options in the article below:
https://technet.microsoft.com/en-us/library/cc733145(v=ws.11).aspx
Logging Options :
/L :: List only - don't copy, timestamp or delete any files.
/X :: report all eXtra files, not just those selected.
/V :: produce Verbose output, showing skipped files.
/TS :: include source file Time Stamps in the output.
/FP :: include Full Pathname of files in the output.
/BYTES :: Print sizes as bytes./NS :: No Size - don't log file sizes.
/NC :: No Class - don't log file classes.
/NFL :: No File List - don't log file names.
/NDL :: No Directory List - don't log directory names./NP :: No Progress - don't display percentage copied.
/ETA :: show Estimated Time of Arrival of copied files./LOG:file :: output status to LOG file (overwrite existing log).
/LOG+:file :: output status to LOG file (append to existing log)./UNILOG:file :: output status to LOG file as UNICODE (overwrite existing log).
/UNILOG+:file :: output status to LOG file as UNICODE (append to existing log)./TEE :: output to console window, as well as the log file.
/NJH :: No Job Header.
/NJS :: No Job Summary./UNICODE :: output status as UNICODE.
Follow the instruction and choose the switch you would like to apply.
Regards
Please mark the reply as an answer if you find it is helpful.
If you have feedback for TechNet Support, contact [email protected]
Thanks! :)