Off-Topic > Off-Topic - Tiny Core Lounge

Help needed! how to rebuild/replace a log file?

(1/1)

malkhalel:
Hi,
I've been on very long, dangerous & full of surprises journey, sailing in the Internet world looking for an answer to my problem but saldy enough I found none. However, I came across this forum and decided to post these letters you're reading right now, hopping that a good soul of you guys would be experienced enough and willing to help!

So, the problem is that I had a very important log file on my server that got too large that I couldn't open it anymore, so i had to replace it with an new 1.  and this was the first time I replace the particular file.  (That was like a week ago)
Usually when something like this happens to me, I just rename the old file and make a new text file with the same name and rights... And now the darn thing is still blank 1 week after, when it's supposed to add about 60 lines every couple of hours. I rechecked the rights under bot CHOWN and CHMOD and they are both as they're supposed to be.

My question is, is there any way to check which script has generated the file? Or to delete the data from the large file and rename it back to original ?

Additional info.
- The log belongs to SendMail
- I do file management under midnight commander in Unix
- I think that SendMail got somehow confused after I changed the file and I have to rest something in order for the new file to be recognized again?
- I restarted the whole darn server but that didn't help :(
- Any idea would be appreciated!

Big THANKS in advance!

Rich:
Hi malkhalel
If you want to truncate the over sized file, meaning its size gets set to zero and you lose the data in it, this works
in Linux:

--- Code: ---> filename
--- End code ---
I've never dealt with Unix, so I don't know if it will recognize that.

malkhalel:
Thank you sir, it worked! However, I don't know if SendMail service will recognize it or not. I'll report later for its status.

Again, Thanks!

malkhalel:
It still not working :/

Does any 1 have experience with SendMail?

Navigation

[0] Message Index

Go to full version