Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm newbie on UNIX/LINUX.

My postfix log file is at /var/log/maillog, yesterday i emptying the file using "1,$d" command and then ":wq!" from vi because the content to big for me to read, but then every postfix interactions does not logged into that file.

I try to remove that file and create it again with no luck.

Anyone can help me to solve this problem?

Thank you.

Best regards.

share|improve this question
Are you saying that your file is too big and you can't read it, then you deleted it and now nothing is being registered to it (if i got it wrong please explain what you want and what is happening better, it is too confusing) ? try: rm -rf /var/log/maillog; touch /var/log/maillog as root to recreate it empty or if u dont want to erase the current file: mv /var/log/maillog /var/log/maillog.1; touch /var/log/maillog – Prix Sep 12 '10 at 3:16
Thank you for your solution, but suddenly the postfix log is not empty anymore, i try to make some wrong configuration on postfix ^_^, quite strange. – user54015 Sep 12 '10 at 4:33

If you delete a file that some process has a file handle to (which is what it uses to write to a file) but don't restart the process that is doing the writing then it will continue writing to the old file.

This is a common mistake that new unix admins make-- they may try to reclaim disk space by deleting a very large log file, not realizing that the space isn't actually available until the file is no longer open.

What I suspect happened (overnight) is that your syslog process was HUP'd by a cronjob, causing it to close all files and reopen them.

In the future, a safer way to truncate a log file that you truly don't care about is to do this:

> /var/log/that_logfile

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.