From 1a23b6822f12f911b648c3d6f6dc73513b7c7554 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Fri, 18 Aug 2017 11:21:06 -0600 Subject: [PATCH] Update fusionpbx-maintenance.sh --- debian/resources/backup/fusionpbx-maintenance.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/debian/resources/backup/fusionpbx-maintenance.sh b/debian/resources/backup/fusionpbx-maintenance.sh index f1f6126..f4b581c 100755 --- a/debian/resources/backup/fusionpbx-maintenance.sh +++ b/debian/resources/backup/fusionpbx-maintenance.sh @@ -35,6 +35,15 @@ fi #delete from the database #psql --host=127.0.0.1 --username=fusionpbx -c "delete from v_fax_files WHERE fax_date < NOW() - INTERVAL '90 days'" +#delete call recordings older than 90 days +if [ .$switch_package = .true ]; then + find /var/lib/freeswitch/recordings/*/archive/* -name '*.wav -mtime +90 -exec rm {} \; + find /var/lib/freeswitch/recordings/*/archive/* -name '*.mp3' -mtime +90 -exec rm {} \; +else + find /usr/local/freeswitch/recordings/*/archive/* -name '*.wav -mtime +90 -exec rm {} \; + find /usr/local/freeswitch/recordings/*/archive/* -name '*.mp3' -mtime +90 -exec rm {} \; +fi + #delete voicemail older than 90 days if [ .$switch_package = .true ]; then echo ".";