Page 1 of 1

auto delete call recordings

PostPosted: Wed Jan 13, 2021 7:28 am
by justinmoodley3
afternoon Gents

i got a question ,how do i set my call recordings to auto del every 30- 60 days

Kind regards
Justin

VERSION: 2.14-611c BUILD: 200909-0952

Re: auto delete call recordings

PostPosted: Thu Jan 14, 2021 6:46 pm
by williamconley
Vicidial's crontab -e list already has some of this.

You want to delete these files Original WAV files nightly, all of them, since they are redundant once the MP3s are created:

Code: Select all
/var/spool/asterisk/monitorDONE/ORIG


Then the MP3s should be pushed to dated folders on an FTP server (that also happens to be a web server) so you can get them off your Vicidial server to reduce storage requirements. There's a crontab entry for:

Code: Select all
/usr/share/astguiclient/AST_CRON_audio_3_ftp.pl


This script uses the credentials for recordings in /etc/astguiclient.conf. Once that script has harvested all the MP3s, the files in question will have been moved to:

Code: Select all
/var/spool/asterisk/monitorDONE/FTP


So the files in this FTP folder are automatically redundant, indicating that they have been moved to another location via FTP and may also be removed, just like the ORIG folder.

But to directly answer your question, if all you want is to delete those MP3s after 30 days, this line will do the trick:

Code: Select all
25 1 * * * /usr/bin/find /var/spool/asterisk/monitorDONE/MP3 -maxdepth 2 -type f -mtime +30 -print | xargs rm -f


Put that with the other xargs rm -f lines in crontab -e.

Re: auto delete call recordings

PostPosted: Thu Jan 21, 2021 9:38 am
by justinmoodley3
Thank you for your help much appreciated

Kind regards
Justin