Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

_logfile Issue

Dec
231
2
I was noticing some strange things happening with my _logfile. I have TCMD setup to log as follows:

Logs.png

I setup two TCC processes, in first I ran:

do forever (echo ------ >>%_logfile)
The first process had a PID of 19700

Yes, this TCC process is constantly feeding the logfile.

The second TCC, I ran:

echo "%@Filelock[%_logfile]"

and I would run this over and over manually and some of the results were:

"4 19700" strange, system process (PID: 4) and the first TCC (PID: 19700)
"19700" this one is okay
"4" system process
"" No process has a lock on it.​

where did the "4 " come from? I think it is the SYSTEM process which is PID 4, but "4 19700" would mean that two processes having a lock on the same file? @Filelock is also sending back two process ids, the documentation does not indicate it should be doing this.

Occasionally I would also get:

TCC: (Sys) The parameter is incorrect.
"C:\JPSoft\Logs\Commands.txt"

I got the above error when the first TCC process lost connection to the file attached to _logfile. After killing the "DO" loop on the first TCC process, If I typed :

echo %_logfile

you would get:

ECHO is off

instead of the file name attached to _logfile. I don't know why the connection was broken.
 
echo ^n---- <.BTM Filename> <Process Id> ----^n >>%_logfile

To tell me what has just started and it's pid so when I open the _logfile to look at it, I don't have dig around for the information.
 
Last edited:
echo ^n---- <.BTM Filename> <Process Id> ----^n >>%_logfile

To tell me what has just started and it's pid so when I open the _logfile to look at it, I don't have dig around for the information.

I have something like this
Code:
echo Running (%_batch) %_batchname at %_date  %_time

That will go into the log file, of course, and also display it. If you don't want to display it on the screen, add
Code:
> nul
to it, or use the LOG verb instead of ECHO.

Code:
LOG Running (%_batch) %_batchname at %_date  %_time

The PID shows up in the log file entry. Here's an example:
Code:
[03-21-16 12:59:04][8140] echo Running (1) C:\Users\DCantor\Work\taskwatch1.bat at 21-Mar-2016 12:59:04 EDT
 
LOG would probably do what I want, using the redirect ">" and ">>" is just a habit.

LOG ^n^n---- <.BTM Filename> <Process Id> ----^n
 

Similar threads

Back
Top