Topic: How to auto delete the recordings in vicidial which is older than x number of days.
Description: step by step guide to delete the old recordings automatically, which are older than x no of days
Deleting Vicidial MP3 Recordings:
If you are using MP3 Format of recordings in vicidial , Run the below command to delete recordings which are 30 days old/usr/bin/find /var/spool/asterisk/monitorDone/MP3 find -maxdepth 2 -type f -mtime +30 -print | xargs rm -vf
If you want the system to automatically delete the recordings which are 30 days old (eg last month recordings)
Enter the Below Line in your crontab, type crontab -e to enter to the cronjob file and paste at firt line.
This will run the command every day 23:59 and delete files which are 30 days old.
23 59 * * * /usr/bin/find /var/spool/asterisk/monitorDone/MP3 find -maxdepth 2 -type f -mtime +30 -print | xargs rm -f
Note: mtime +30 , modify this as per your requirement.if you want to delete 60 days then enter mtime +60.
Deleting Vicidial GSM Recordings:
For deleting the GSM format recordings files, run the below command at linux console.
/usr/bin/find /var/spool/asterisk/monitorDone/GSM find -maxdepth 2 -type f -mtime +30 -print | xargs rm -vf
For automatically deleting the GSM recordings copy paste the below command in cronjob, type crontab -e to enter to the cronjob file and paste it at first line
23 59 * * * /usr/bin/find /var/spool/asterisk/monitorDone/GSM find -maxdepth 2 -type f -mtime +30 -print | xargs rm -f
Deleting Vicidial WAV Recordings in ORIG folder:
For Manual delete type the below command at linux console
/usr/bin/find /var/spool/asterisk/monitorDone/ORIG find -maxdepth 2 -type f -mtime +30 -print | xargs rm -vf
For automatic delete enter the below command in cronjob
23 59 * * * /usr/bin/find /var/spool/asterisk/monitorDone/ORIG find -maxdepth 2 -type f -mtime +30 -print | xargs rm -f