Free Up Space

FreePBX Version:

I’m running out of hard drive space. Are there any files, like temp files, that I can delete to free up some space?

it’s a very open ended question. This a distro build or did you build it by hand? What services are you using? Recordings? Backups? Voicemail? Limits on length of messages and/or limit the number of them?

Some places to look but details about your setup will help direct you better.

If you have the backup module installed and running a backup it creates a file every time it is scheduled to. There is NO file maintenance. So if it has been running for over a year and you do nightly backups you have over 365 files, I’ll bet 300 of them can go away. Look in /var/lib/asterisk/backups/ I every other month manually go into it and delete all files older then 60 days except those from from the 1st and 16th of the month for historical reasons.

If you enabled them then this is probably the biggest disk pig. you’ll need to go in to /var/lib/asterisk/monitor and prune things out.

If it is hand built check /var/log/asterisk. Now big is the full log file. Is it rotated (you’ll find full.1, full.2, full.3, etc files if it is, they might have a ending like .gz or .tgz which means they were compressed). If this file is HUGE and is rotated daily or weekly then you have your debugging and verbose levels turned up and it’s logging that info. I can’t tell you what is to big as it will depend on the volume of traffic you get, number of extensions, etc… BUT if the file is the only one I’d be concerned that it is not being rotated and you’ll need to learn about logrotate and the /etc/logrotate.d directory.

Take a look at /var/spool/mail depending on how the box was built there might be a LARGE file for admin, maint, root, asterisk… these are the raw mail files collecting e-mail messages. root can get the logs of all cron jobs, etc.

Do you know about the linux df and du commands?
typing df -h will show you all the linux partitions disk stats in human readable values.
typing du -sh * will give you a summary of disk space used based on where you are (don’t do this at the root level or you’ll regret it).
try du -sh /var/lib/asterisk , du -sh /var/spool/asterisk, du -sh /var/spool/mail, and du -sh /var/log/asterisk

Sorry it took so long to get back to this topic…

Anyway, the reason I ask is because users are reporting that they no longer get VM attachments. I checked the sendmail config, and corrected an issue in there. I tested sendmail by sending myself an email from the PBX. I got it no problem whereas before it would not arrive. I figured my job was done…then users told me they still weren’t getting attachments.

So I checked the server and found that the drive only had 5% space left. So I assume it’s because of that. So I figured that i’d delete some files and clear up space to see if that did the trick.

running a box with less then 10% space it just begging for things to go wrong… The system does some performance tuning and optimization on file placement automatically. But when you have less then 10% disk free things start to not work well. you are now using the far out reaches of the disk that perform slower, etc. you are makign the heads move further and further so things slow down…

We monitor and start clean up processes on all linux boxes when we hit 80% used.