Auto-deletion of call recordings?

Discussion in 'General' started by acs3121, Jan 27, 2011.

  1. acs3121

    Joined:
    Jan 27, 2011
    Messages:
    5
    Likes Received:
    0
    I have a customer that wishes to record all of their phone conversations.

    The problem is they never remember to do any house-cleaning and fill up their storage.

    Is there any way to have the PBX auto delete call recordings older than x days or better yet, start deleting the oldest recordings first when the storage gets x% full?
     
  2. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    To delete all *.wav files over 90 days

    Code:
    /usr/bin/find /var/spool/asterisk/monitor/*.wav -mtime 90 -delete
    
    for the percentage based solution:

    Code:
    while (( `df /|/usr/bin/tail -1|/usr/bin/awk '{print $5'}|/bin/sed 's/\%//'` >= 76 ));do  /bin/rm -f `/bin/ls -tr /var/spool/asterisk/monitor/*.wav| /usr/bin/head -n 1` ;done
    
    where 76 is the percentage desired, head -n 1 is one file at a time, season to taste

    use these commands in a cron job.

    dicko
     
  3. acs3121

    Joined:
    Jan 27, 2011
    Messages:
    5
    Likes Received:
    0
    AWESOME, I'll give it a try.

    THANKS!

    Cameron
     
  4. MageMinds

    Joined:
    Jun 26, 2008
    Messages:
    55
    Likes Received:
    0
    Thanks, very helpfull!!!
     

Share This Page