TIPS Disk almost full. Where to clean out files?

RoboLord

Member
Joined
Aug 18, 2017
Messages
56
Reaction score
5
I have a 13-13 install on CentOS 6.9, running inside a Proxmox container. This one is used exclusively as a fax machine with Incredible Fax. I had 5 months of uptime without a single hiccup, then yesterday the PBX stopped answering calls.

I checked in the Hylafax front end and deleted a ton of old faxes. I rebooted and it worked for most of today then went down again. I just went into an SSH session and ran 'df' and found that /dev/sda2 is running at 88% full and /dev/sda1 is running 70% full.

I'm not sure if this would be enough to crash the system, however I'm guessing it wouldn't hurt to go in and prune some log files and whatnot. Anyone have a suggestion on where to look for some low hanging fruit to clean up on these volumes? Thanks!
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,170
Reaction score
5,199
Good places to start:

/var/log
/var/log/asterisk
 

ostridge

Guru
Joined
Jan 22, 2015
Messages
1,618
Reaction score
517
I remembered a script here somewhere that purges files created by call monitor;and which also are HDD killers. So I did a search for 'purge recordings' which throws up 4 posts here

Maybe when you know where your faxes are stored; that script could perhaps be a start point for a similar script for faxes?
 
Last edited:

dicko

Still learning but earning
Joined
Oct 30, 2015
Messages
1,607
Reaction score
826
Faxes are stored in two places, hylafax keeps the ps in /var/spool/hylafax/*q

Avantfax keeps the pdf's in your web servers'documentroot/avantfax/faxes

A GUI thing, install ncdu and

ncdu /
 
Last edited:

krzykat

Telecom Strategist
Joined
Aug 2, 2008
Messages
3,145
Reaction score
1,235
We've added this to our routines that allows you to record all calls if you want, but still not run out of disk space, just purging the oldest audio recordings:

To crontab add:

# Purge Audio Recordings along with empty directories
5 5 * * * root /etc/purgeVCDR

runs daily at 5:05 am ... tweak to your liking

create a file in /etc/ called purgeVCDR - make sure its executable:

Code:
#!/bin/bash


while (( `df /|/usr/bin/tail -1|/usr/bin/awk '{print $5'}|/bin/sed 's/\%//'` > 90 ))
do
/bin/rm -f `/bin/find /var/spool/asterisk/monitor/ -name "*.wav" -ls | /usr/bin/awk '{print $11'} | sort -n | /usr/bin/head -n 1`
cmd=$(/bin/find /var/spool/asterisk/monitor/ -name "*.wav" -ls | /usr/bin/awk '{print $11'} | sort -n | /usr/bin/head -n 1)
  if [ -z "$cmd" ]; then
    exit
  fi
done

find /var/spool/asterisk/monitor/ -empty -type d -delete
Note: Code is set to have at max 90% usage - tweak as desired.
 

Members online

Forum statistics

Threads
25,782
Messages
167,514
Members
19,203
Latest member
frapu
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top