A way to delete record files from asterisk server

General and Support topics relating to ViciDialNow and GoAutoDial ISO installers

Moderators: enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, s0lid

A way to delete record files from asterisk server

Postby yasserin » Wed Oct 08, 2008 12:00 pm

Hi, I'd been having the .cvs problem, I think it is cause when the crontab is trying to delete the old files (log and recordings) from the server , I set that the recordings has to be delete every two days heres the crontabs from it removal task:

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

### remove old vicidial logs and asterisk logs more than 2 days old
28 0 * * * /usr/bin/find /var/log/astguiclient -maxdepth 1 -type f -mtime +2 -print | xargs rm -f
29 0 * * * /usr/bin/find /var/log/asterisk -maxdepth 3 -type f -mtime +2 -print | xargs rm -f


I dont know maybe I did something wrong, Or maybe I can setup the mp3 ftp script to delete each file when this is send via ftp to the data server

Can you please tell me if I didi something wrong on the crontab and how I can modify the script to delete immediately when the record is send via ftp (if this can be done)
yasserin
 
Posts: 42
Joined: Fri Jan 25, 2008 11:20 am

Postby mflorell » Wed Oct 08, 2008 2:32 pm

The recording transfer scripts do not delete files.

What exactly is a ".cvs problem"?
mflorell
Site Admin
 
Posts: 18383
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Postby yasserin » Mon Oct 13, 2008 1:12 pm

Every two days I receive a his error

Sep 25 19:08:01 WARNING[3276]: res_agi.c:210 launch_netscript: Connect to 'agi://127.0.0.1:4577/call_log' failed: Connection refused
== Spawn extension (default, 447511202, 1) exited non-zero on 'SIP/3047-b78541f0'
Sep 25 19:08:01 ERROR[3276]: cdr_csv.c:237 csv_log: Unable to re-open master file /var/log/asterisk//cdr-csv//Master.csv : Read-only file system
Sep 25 19:08:01 ERROR[3276]: cdr_custom.c:129 custom_log: Unable to re-open master file /var/log/asterisk/cdr-custom/Master.csv : Read-only file system


I believe this is cause for the logs and record delete task, or maybe not... but I need to know if theres a way to delete the old ORIG files so my server do not full the HD with copies of files that has been already send to another server via FTP
yasserin
 
Posts: 42
Joined: Fri Jan 25, 2008 11:20 am

Postby mflorell » Mon Oct 13, 2008 6:25 pm

This will remove old recordings from ORIG after 7 days(from the SCRATCH_INSTALL doc):
24 0 * * * /usr/bin/find /var/spool/asterisk/monitorDONE/ORIG -maxdepth 1 -type f -mtime +7 -print | xargs rm -f
mflorell
Site Admin
 
Posts: 18383
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: A way to delete record files from asterisk server

Postby yasserin » Tue Oct 14, 2008 8:44 am

Yeah I know, I change it to every 2 days heres my crontab:

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


I dont know If I did it right, I change the 7 for 2, Thats why I believe that it is causing me the master.cvs problem cause it is happening to me also every two days. Also If I run manually the
/usr/bin/find /var/spool/asterisk/monitorDONE/ORIG -maxdepth 2 -type f -mtime +2 -print | xargs rm -f
It gives me the above problem.

Is there another way to delete the record one by one when it is sent to my ftp server???

Thanks by the way Matt for all the support
yasserin
 
Posts: 42
Joined: Fri Jan 25, 2008 11:20 am

Postby mflorell » Tue Oct 14, 2008 11:46 am

That command should have nothing to do with your asterisk logs.

To delete files upon upload you would need to add a rm line to the FTP audio script.
mflorell
Site Admin
 
Posts: 18383
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Postby yasserin » Tue Oct 14, 2008 12:05 pm

But theoretically this is all right???
/usr/bin/find /var/spool/asterisk/monitorDONE/ORIG -maxdepth 2 -type f -mtime +2 -print | xargs rm -f
To erase every two days LL THE ORIG RECORDS???
yasserin
 
Posts: 42
Joined: Fri Jan 25, 2008 11:20 am

Postby mflorell » Tue Oct 14, 2008 6:36 pm

That command will erase recordings older than two days old.
mflorell
Site Admin
 
Posts: 18383
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida


Return to ViciDialNow - GoAutoDial

Who is online

Users browsing this forum: No registered users and 60 guests