Some character adding up starting of log file?
The logrotate is setup in one of the RHEL Machine and I could see surprising character at the top of the log file as:
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@ ^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@ ^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@ ^@^@^@^@^@^@^@^@^@^@^@^@^@^@ upto certain lines everytime. What could be the issue. |
Exactly which file is this junk appearing in?
|
Its a customized log location in a file with extension .log
Generally what could be possiblilty of being ^@ added at the line 1 If I do :2 in commandline of log file it works fine. |
Quote:
Also, maybe it isn't important, but this logfile, it is a log created by what application? Or is it a common/usual Linux system generated log? In other words, what process(s) are writing to the logfile? |
Code:
#!/bin/bash |
OK, so would it be fair to suppose that this problem has little or nothing to do with `logrotate`, but
is very likely to have something to do with that script: /tools/jboss/jboss4/jboss-as/bin/run.sh either directly, or indirectly via a problem or typo with one of those arguments provided to the script: -b testserver11.com -c testserver.com \ -Datg.dynamo.data-dir=/fixer/hjs/config/ATG-Data \ -Datg.dynamo.server.name=testserver.com If you have double-and-triple checked that all these command-line arguments are correct, I would be then looking at the above mentioned script itself. Is there code inside the `run.sh` script which would generate literally the junk you get in the log? If so, examine the conditions required to cause the junk to be outputted. Has this process ever worked correctly in the past? Without the crap in the logs? I.e. have you used this software before and it worked OK? If so, what's different this time? Sasha |
My logrotate file:
Code:
##################### Source log file ###################### |
My run.conf file:
Code:
Code:
#!/bin/sh |
Seems that run.sh is making the log file as binary.
The log created is a data file not normal log file. |
How to delete the first line of a file without creatign the temporary file?
I have a log file which generates the junk character at the first line. I want to write a script to remove it without disturbing the file or creating the temporary file(
I tried this : sed 1D test > tempfile. But I dont want to create a temp file as jboss might be using that file. Can it be done? |
How about using the in-place flag
Code:
sed -i 1D test |
Can I make it this way:
I need a script which will copy the log file(say A) in seperate new file(say B). Remove the first line from B and copy it back to A. Will it affect the log writing. anyone who can help me with this script. |
evo2,
Never used that command option -i. Will it not disturb the log writing. Are you sure? |
Quote:
Quote:
Evo2. |
A question: Can you not wait until the process has finished writing to the file?
Evo2. |
All times are GMT -5. The time now is 10:45 AM. |