Delete voice recordings older than N-days

Disk space is running out quickly in loaded telephony systems with instant call recording or heavy usage of voicemail. It’s good to purge them on a regular basis.

Create an executable bash file and put it in the cron.daily directory:

cd /var/spool/asterisk/monitor

# replace rm -f if you want to do other file 
# manipulations, i.e. backup first...
find . -mtime +31 -exec rm -f {} \;