Jump to content

Recommended Posts

Posted

With nothing better to do on a sunny saturday afternoon i am trying to knock a script that will examine a robocopy text file (used for mirroring data) and dump the summary into a seperate log file which i will use blat to email me.

 

this is what i have knocked up so far

 

REM this batch file will sync srv11 H:\common data to srv5 H:\common2

Set logfile=E:\logs\commonMIR1.log

Set logfile2=E:\logs\commonMIR2.txt

 

Echo Started %date%,%time% >>%logfile%

Echo ----------------------------------- >>%logfile%

Echo mirroring common directory on SRV11 to SRV5 common2 >>%logfile%

Echo. >>%logfile%

robocopy "x:\COMMON" "y:\COMMON2" /MIR /ZB /W:0 /A /LOG:E:\logs\COMMONmir2.TXT

Echo ----------------------------------- >>%logfile%

Echo Finished %date%,%time% >>%logfile%

Echo ----------------------------------- >>%logfile%

Echo RESULT OF ROBOCOPY COMMON FOLDER MIRROR SCRIPT >>%logfile%

type %logfile2% >>%logfile%

 

it works well however the whole contents of the robocopy log appear in the commonMIR1.log.

thanks

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...