Tuesday, June 13, 2017

Schedule Daily Job on Deletion of Old Recordings

I previously wrote an entry on freeing up space in Vicidial by deleting old recordings and log files (see here). Previously, I didn't have to do this frequently. Now, I have to perform this every 2-3 days thanks to the high volume of calls.

With that, I learned that scheduling this job daily saves me a lot of time from having to do this manually by editing the cron file.

Type in SSH
crontab -e

Add to the bottom then save
### remove WAV files and remove log file daily at after office hours
30 18 * * * rm -f /var/spool/asterisk/monitorDONE/ORIG/*.wav
30 18 * * * rm -f /var/log/httpd/*
35 18 * * * sudo reboot

For this job I've scheduled, it's set to delete old WAV files and logs at 6:30pm then reboot at 6:35pm every day. For more info on the how to add jobs in cron, check here.



No comments:

Post a Comment