Talk:Auto-deletion of call recordings/@comment-73.175.0.85-20160720193903

I created this while back...

[code]


 * 1) !/bin/bash

TERM=linux

EXPORT TERM

KEEP_FAXES=180

KEEP_RECORDINGS=180

KEEP_BACKUPS=180

KEEP_VOICEMAIL=5

clear

logger -s “————[Starting Script $0]————”

logger -s “Removing Old Guest Voicemails older than $KEEP_VOICEMAIL”

echo “Removing Old Voicemails”

/usr/bin/find /var/spool/asterisk/voicemail/default/ -type f -mtime +$KEEP_VOICEMAIL -delete

logger -s “Removing Recorded Calls That are older than $KEEP_RECORDINGS“

echo "Removing Old Recorded Wav Files”

/usr/bin/find /var/spool/asterisk/monitor/ -type f -mtime +$KEEP_RECORDINGS -delete

echo “Removing Empty Directories from Recorded Calls”

/usr/bin/find /var/spool/asterisk/monitor/ -type d -empty -mtime +$KEEP_RECORDINGS -delete

logger -s “Removing old Backups which older than $KEEP_BACKUPS”

echo “Removing Old Backups”

find /var/www/backup/*.tar -type f -mtime +$KEEP_BACKUPS -print -exec rm {} \;


 * 1) logger -s “Removing Old Faxes older than $KEEP_FAXES”


 * 1) echo "Removing Old Recieved Faxes Files”


 * 1) find /var/spool/hylafax/recvq/*.tif -type f -mtime +$KEEP_FAXES -print -exec rm {} \;


 * 1) echo "Removing Old Logs for Faxes Files"


 * 1) find /var/spool/hylafax/log/* -type f -mtime +$KEEP_FAXES -print -exec rm {} \;


 * 1) echo "Removing Old Log Files "


 * 1) find /var/log/* -type f -mtime +365 -print -exec rm -fr {} \;

echo "Done Cleaning Up.”

logger -s “————[Finished Script $0]————”

[/code]