Blog

Latest Technical Notes

Automatically Delete Call Recordings in FreePBX

A simple script to delete call recordings. Note that this has been designed to work hand-in-hand with our other script, that coverts the recordings to MP3 to save space: FreePBX – convert WAV call recordings to MP3

You can easily modify the script to delete call recordings that are in WAV format, or for different periods of time, by altering the “*.mp3” to “*.wav” and by modifying the +365 to +30 +60 +90 etc.


#!/bin/bash
# A script to delete old FreePBX call recordings
# Version 1 - 2016/12/08
#
# Changelog
# v1 - Initial Version
#
# Copyright Jaytag Computer Limited 2016 - www.jaytag.co.uk
#
# You may use or modify this script as you wish as long as this copyright
# message remains. Redistribution prohibited.
#
# Find all recordings older than 365 days and delete
find /var/spool/asterisk/monitor -name "*.mp3" -mtime +365 -delete

DamianAutomatically Delete Call Recordings in FreePBX
Share this post

Join the conversation