Older box - suddenly out of diskspace - why?

Kernel Version 2.6.18-128.1.10.el5 (SMP)
Distro Name CentOS release 5.3 (Final)
Asterisk 1.4.22-4
~ 25 extensions
PRI
Rhino box, and Rhino PRI TDM
140GB HDD

3 months ago, I noticed the diskspace was critical. I checked and it’s backups had never been deleted (4yrs). I removed about 3 years of backups, and diskspace was down around 20%.

Today I look at the box, user complaints, and it’s at 98%. I checked the backups, and removed them all, about 3-6months worth. It freed up 5%. There are no backups. I checked users VMs. There are less than 30 VMs on the server. I checked emails - I removed about 8K emails from PostFix - but that was only about 20Mb. It’s at 93% full, and I can’t tell what is taking up all the diskspace.

Any ideas?

du -xh --max-depth=1 /

find the big one then

du -xh --max-depth=1 /var

find the big one etc.

OK - yea … so my event_log is over 134GB
I think I may have turned my logging to Debug level. Can I just delete the that log file. Isn’t there a way to cap - put on a size limit.

(has turned into more of a Linux Q over an Asterisk one)

Thanks for your help!

Normally logrotate should take care of that, including history saved and compression applied, you should investigate /etc/logrotate* and get it working.

A quick fix is not delete the file but truncate it with

echo -n > /var/log/(file)

Correction

ls -l

total 134611688
asterisk asterisk 4096 Apr 27 2010 cdr-csv
asterisk asterisk 4096 Apr 27 2010 cdr-custom
asterisk asterisk 0 Apr 27 2010 event_log
asterisk asterisk 0 Mar 28 17:49 freepbx-bounce_op.log
asterisk asterisk 137707700371 Mar 28 21:06 full
asterisk asterisk 22766 Mar 28 18:17 queue_log

it’s the log file "full"
I don’t know what that is. Is that the Asterisk standard log file. (Hard to believe I’ve never ran across this before)

Asterisk’s log files are defined in /etc/asterisk/logger* files

full is usually defined and rotated, you must have done something to break that behavior. (I have a suspicion that logrotate is not working at all)

Asterisk log file rotations should be defined in in:-

/etc/logrotate.d/asterisk

But start with

man logrotate

. . .

/var/log/asterisk/full {
missingok
notifempty
sharedscripts
create 0640 asterisk asterisk
postrotate
/usr/sbin/asterisk -rx ‘logger reload’ > /dev/null 2>
/dev/null
endscript
}

This looks like what I need. I at least know what’s going on.
Thanks again.

But start with

man logrotate

a “normal” one might look like:-

/var/log/asterisk/*log {
missingok
rotate 5
weekly
create 0640 asterisk asterisk
postrotate
size=250m
/usr/sbin/asterisk -rx ‘logger reload’ > /dev/null 2> /dev/null
endscript
}

/var/log/asterisk/full {
missingok
rotate 5
daily
create 0640 asterisk asterisk
postrotate
size=250m
/usr/sbin/asterisk -rx ‘logger reload’ > /dev/null 2> /dev/null
endscript
}

/var/log/asterisk/cdr-csv/*csv {
missingok
rotate 5
monthly
create 0640 asterisk asterisk
}

Yea, you have to add the asterisk (and now freepbx) logrotate scripts. I don’t know why the Asterisk “make samples” or FreePBX “install_amp” doesn’t add that but it’s still very much a manual thing that needs to be done. Maybe because different Linux distributions use different directories for that?