Re: CMD.EXE and ">> logfile"



Hi Peter,

Worth checking if you have any > instead of >> in any of your scripts.As you know > will overwrite the central.log file and *not* append..
Also what is the point in writing simultaneously which can result in garbled letters if possible to write! Only one application would need to write to a log at a time and then followed by other!

rgds
Babu
After serious thinking Peter Juuls wrote :
I use scheduled batch files do many automated tasks on my Win2000/Win2003 servers, like checking for available diskspace. All batch files write to a single logfile on the local disk, so I only need to check one logfile for problems. Batch files always append a new line to the bottom of the logfile, ex.
ECHO %DATE% %TIME% : Diskchecker says: Space is ok. >> central.log

PROBLEM: From time to time, the logfile is being deleted, for no obvious reason. It seems to happen only when two batch files simultanously append a record to the bottom of the logfile. CMD.EXE or some NTFS filesystem module should coordinate this process and ensure that both records are appended, instead of deleting the file, but apparently does not.

Q: How can I solve this? (I don't want to split up "central.log" into seperate logfiles)

Best regards
Peter Juuls


.



Relevant Pages

  • CMD.EXE and ">> logfile"
    ... I use scheduled batch files do many automated tasks on my Win2000/Win2003 ... single logfile on the local disk, so I only need to check one logfile for ... Batch files always append a new line to the bottom of the logfile, ... It seems to happen only when two batch files simultanously append a ...
    (microsoft.public.windows.server.scripting)
  • Re: How do I send stdout to file and stderr to both file & tty?
    ... they have to work in append mode. ... The program's standard output needs to be duplicated into the standard ... errors) to the logfile and show it as well: ... The shell's>> and tee -a are not actually using proper append mode on ...
    (comp.unix.shell)
  • RE: simple open file
    ... |I'm trying to open a file for APPEND, ... |serve as a log. ... You havent specified the FILEHANDLE to write to in 'write'. ... close LOGFILE; ...
    (perl.beginners)
  • can anyone help me about rotation Logging issue
    ... Archieving log file before logging rotation (define ... logfile size,number) ... only can copy file but append file. ... fileSize, fileNumber, append); ...
    (comp.lang.java.programmer)
  • Re: CMD.EXE and ">> logfile"
    ... I came up with a trick to avoid running too many of the same process at once, you may be able to modify it for your purposes: ... The reaoson I wrote this was I was cleaning up a WINS database and was sending a owner delete command to each of our 50 WINS servers using netsh. ... single logfile on the local disk, so I only need to check one logfile ... Batch files always append a new line to the bottom of the ...
    (microsoft.public.windows.server.scripting)

Quantcast