This script allows to automatically delete voice call recordings every night at 1:15am.
This will delete all recordings older then 60 days.
You need to created a cron job on freePBX server.
- SSH into your server and at the prompt, type (this will create a new cronjob on your server and enter “vi editor”):
- Press esc
- Press i (for “insert”) to begin editing file
- Paste/type the following text into corn job
15 1 * * * find /var/spool/asterisk/monitor/ -name “*.wav” -mtime +60 -delete >/dev/null 2>&1
- Press esc again to exit editing mode
- Type :wq to save (w – write) and to exit (q – quite) the file.
- Verify your cronjob:
You are all set, your server will now delete older recordings every night.
If you need to change time when this happens check out this page to see how to modify cron job