CRON jobs to clean old MONITOR files

Good afternoon, all.

Based on some previous threads in these forums, I ended up creating the following cron jobs in hopes of clearing out old recordings (over 32 days old). I initially added them to the “asterisk” cron file, but on reboot the contents of that file was replaced (I’m assuming FPBX did that on boot to ensure all it’s maintenance services are intact).

So, I then put them in the “root” cron file, but it doesn’t seem like they’re being executed. The root file was empty so I added these 4 lines:
@daily find /var/spool/asterisk/monitor/ -name “.wav” -mtime +32 -delete >/dev/null 2>&1
@reboot find /var/spool/asterisk/monitor/ -name “
.wav” -mtime +32 -delete >/dev/null 2>&1
@daily find /var/spool/asterisk/monitor/ -type d -empty -delete
@reboot find /var/spool/asterisk/monitor/ -type d -empty -delete

The intent of these lines is to erase all .wav files that are more than 32 days old, then delete empty directories. Additionally, to run daily as well as at boot up. Unfortunately, at reboot, everything was still there.


This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.