TIPS Disk almost full. Where to clean out files?

RoboLord

Member
Joined
Aug 18, 2017
Messages
58
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!
 
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:
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:
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

No members online now.

Forum statistics

Threads
26,696
Messages
174,453
Members
20,265
Latest member
irenelanda64
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.
Back
Top