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.