WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Help needed! how to rebuild/replace a log file?  (Read 2619 times)

Offline malkhalel

  • Newbie
  • *
  • Posts: 3
Help needed! how to rebuild/replace a log file?
« on: October 25, 2012, 02:46:12 PM »
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!


Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11703
Re: Help needed! how to rebuild/replace a log file?
« Reply #1 on: October 25, 2012, 05:49:15 PM »
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: [Select]
> filenameI've never dealt with Unix, so I don't know if it will recognize that.

Offline malkhalel

  • Newbie
  • *
  • Posts: 3
Re: Help needed! how to rebuild/replace a log file?
« Reply #2 on: October 25, 2012, 06:37:15 PM »
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!

Offline malkhalel

  • Newbie
  • *
  • Posts: 3
Re: Help needed! how to rebuild/replace a log file?
« Reply #3 on: October 29, 2012, 12:03:08 PM »
It still not working :/

Does any 1 have experience with SendMail?