Comments
4 comments
-
Hello,
Sorry for my confusion, but which log are you referring to? -
Sorry about the delay - I've been chasing my tail with some other projects of late.
The logs I refer to are the ones created by Command Line when it runs the Data Compare Scripts. Currently I have three projects running in one batch file (which is scheduled every hour), and the results being appended to a .txt file. With the results being appended without any date/time stamp, it becomes difficult to ascertain exactly when problems have started to occur.
I hope this makes sense!
Cheers -
You can use the date and time commands in your script file to append the dates and times into your script, for example:
REM Save this test as datasync.bat @ECHO OFF FOR /F "tokens=1-3 delims=/ " %%i IN ('DATE /T') DO SET thedate=%%i-%%j-%%k FOR /F %%i IN ('TIME /T') DO SET thetime=%%i ECHO Database Comparison on %thedate% at %thetime% >> DataCompare-%thedate%.txt "c:\program files\red gate\sql bundle 5\sqldatacompare" /db1:widgetdev /db2:widgetlive >> DataCompare-%thedate%.txt
-
:lol:
Add comment
Please sign in to leave a comment.
1. When appending the log, is it possible to have it generate a timestamp with each new entry?
2. Is it possible to specify the directory where the logs are stored, I've tried but the "address" seems to get truncated during the running of the script.