Page 1 of 1

remove old recordings

PostPosted: Tue Apr 06, 2010 5:45 pm
by gmcust3
When I installed my server, it WAS:

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

Today, after 3 months when My HDD is 80% filled , I uncommented it.

Now, when i reboot, I don't see any decrease in space.

24 0 * * * /usr/bin/find /var/spool/asterisk/monitorDONE -maxdepth 2 -type f -mtime +7 -print | xargs rm -f

"24 0" means it will run at Exactly when its 24 hr on the server time ??

What if that time calling is going on ??

PostPosted: Tue Apr 06, 2010 6:34 pm
by DarknessBBB
Exactly at 00:24 am ;-)

PostPosted: Tue Apr 06, 2010 6:40 pm
by gmcust3
To delete, 350 GB, It will take 3-4 hrs ?

System will go down ?

Preferable to run it when noone logged in ?

PostPosted: Tue Apr 06, 2010 6:40 pm
by gmcust3
To delete, 350 GB, It will take 3-4 hrs ?

System will go down ?

Preferable to run it when noone logged in ?

PostPosted: Wed Apr 07, 2010 1:27 am
by boybawang
depnding on your hard drive speed try this command :

rm -rf /var/spool/asterisk/monitorDONE/ORIG
rm -rf /var/spool/asterisk/monitorDONE/mp3

then recreate those directories again:

mkdir -p /var/spool/asterisk/monitorDONE/ORIG
mkdir -p /var/spool/asterisk/monitorDONE/mp3

usually its the ORIG folder that fills the hard drive since it stores uncompressed WAV files which are like 10 mb upwards

PostPosted: Wed Apr 07, 2010 1:40 am
by Acidshock
Here is a cron job that I use to remove anything older than 20 days. Works a little better IMO.

### remove recording older than 20 days
0 3 * * * find /var/spool/asterisk/monitorDONE -mtime +20 -exec rm {} \;

PostPosted: Sat Oct 02, 2010 6:18 pm
by AlSam
boybawang wrote:usually its the ORIG folder that fills the hard drive since it stores uncompressed WAV files which are like 10 mb upwards

Have you found it safe to delete the contents of the orig folder? My setup has recordings in this folder as well as the GSM folder. So far I have found that the recordings are the same between these two folders. Can't figure out, though, why there are so many copies of the call recordings. ORIG folder has a copy with the word all at the end, a second with the word in at the end (equal in size to the first one), and a third with the word out at the end which is 44 bytes in size. The GSM just has one file per call with the proper file name.

Re: remove old recordings

PostPosted: Wed Dec 21, 2016 6:59 am
by eglantcelniku
I want to delete only the Old reg,I want to keep only the last 2 months?

Re: remove old recordings

PostPosted: Wed Dec 21, 2016 11:35 pm
by rrb555
that is easy and possible

Re: remove old recordings

PostPosted: Sun Jan 15, 2017 5:33 pm
by williamconley
eglantcelniku wrote:I want to delete only the Old reg,I want to keep only the last 2 months?


Deletes the original, uncompressed, copies of the files nightly.

Deletes the FTP folder copy of any files that have already been pushed to the FTP recording archive server nightly, as they are now redundant (if they have not been pushed, it does not delete them). Deletes the MP3 folder (live copy) of all recordings after 65 days.
Code: Select all
26 1 * * * /usr/bin/find /var/spool/asterisk/monitorDONE/MP3 -maxdepth 2 -type f -mtime +65 -print | xargs rm -f
25 1 * * * /usr/bin/find /var/spool/asterisk/monitorDONE/FTP -maxdepth 2 -type f -mtime +1 -print | xargs rm -f
24 1 * * * /usr/bin/find /var/spool/asterisk/monitorDONE/ORIG -maxdepth 2 -type f -mtime +1 -print | xargs rm -f