Page 1 of 1

Auto delete recording

PostPosted: Mon Aug 20, 2012 6:42 am
by kamirie
Good Day ,

Can i change this on crontab

Code: Select all
### remove old recordings more than 7 days old
# 24 0 * * * /usr/bin/find /var/spool/asterisk/monitor -maxdepth 2 -type f -mtime +7 -print | xargs rm -f


to make it delete recordings 30 days old rather than 7 days old? will it be like this?

Code: Select all
### remove old recordings more than 7 days old
# 24 0 * * * /usr/bin/find /var/spool/asterisk/monitor -maxdepth 2 -type f -mtime +30 -print | xargs rm -f


will this also delete recordings in the ORIG folder?

Re: Auto delete recording

PostPosted: Tue Aug 21, 2012 4:54 pm
by Acidshock
I believe you want monitorDONE not monitor. However yes changing the mtime to 30 will cause the system to delete those recordings after 30 days not 7. It will also delete the originals.

Re: Auto delete recording

PostPosted: Tue Aug 21, 2012 10:49 pm
by kamirie
Acidshock wrote:I believe you want monitorDONE not monitor. However yes changing the mtime to 30 will cause the system to delete those recordings after 30 days not 7. It will also delete the originals.


So it will be like this?
Code: Select all
### remove old recordings more than 7 days old
# 24 0 * * * /usr/bin/find /var/spool/asterisk/monitorDONE -maxdepth 2 -type f -mtime +30 -print | xargs rm -f

if i set it like this in crontab -e
Code: Select all
### remove old recordings more than 7 days old
# 24 0 * * * /usr/bin/find /var/spool/asterisk/monitorDONE/ORIG -maxdepth 2 -type f -mtime +30 -print | xargs rm -f

will it erase only the ORIG folder and leave MP3 folder intact?