Page 1 of 1

How to empty the ORIG folder?

PostPosted: Mon May 03, 2010 1:12 pm
by jack bauer
Hi Everybody
every time the webmin shows a full Local disk space, I have to empty the ORIG folder which requires logging through winscp, then taking this path : /root/var/spool/asterisk/monitorDONE/ORIG because it contains all the voice recording so it is the main reason the memory is full
the problem is it takes a long time to open the folder and then to select all the items and deleting them, as winscp often loses connexion with the server so I have to reconnect again and again.
Is there any way to empty it by a written command directly through the server or putty or any similar software??
Thank you in advance

PostPosted: Mon May 03, 2010 1:22 pm
by okli
Don't you have similar lines in your crontab?

Code: Select all
### VICIDIAL clean ORIG recordings older than 3 days
0 1 * * * /usr/bin/find /var/spool/asterisk/monitorDONE/ORIG -maxdepth 1 -type f -mtime +3 -print | xargs rm -f

PostPosted: Tue May 04, 2010 3:42 am
by jack bauer
okli wrote:Don't you have similar lines in your crontab?

Code: Select all
### VICIDIAL clean ORIG recordings older than 3 days
0 1 * * * /usr/bin/find /var/spool/asterisk/monitorDONE/ORIG -maxdepth 1 -type f -mtime +3 -print | xargs rm -f


I am not sure where I can find this line. can you be more specific??
where should I type this command?? in the server itself? putty???

PostPosted: Tue May 04, 2010 7:34 am
by jack bauer
Another question came to my mind:
with this command how long does it take to delete the contents? is it instantly or does it take the same time? does it require server rebooting?
the 3 stars (***) in the command line, do they mean something specific, should I replace them by some other values, or should I just copy paste it to the server/putty??

PostPosted: Tue May 04, 2010 9:17 am
by okli
jack bauer wrote:
okli wrote:Don't you have similar lines in your crontab?

Code: Select all
### VICIDIAL clean ORIG recordings older than 3 days
0 1 * * * /usr/bin/find /var/spool/asterisk/monitorDONE/ORIG -maxdepth 1 -type f -mtime +3 -print | xargs rm -f


I am not sure where I can find this line. can you be more specific??
where should I type this command?? in the server itself? putty???


cron:
http://centos.org/docs/5/html/Deploymen ... tasks.html
http://www.centos.org/docs/4/html/rhel- ... tasks.html
http://www.google.com/search?num=50&hl= ... =&gs_rfai=

To edit:
crontab -e
with this command how long does it take to delete the contents?
Several seconds, depending how many and how large the files are.

does it require server rebooting
No.
the 3 stars (***) in the command line, do they mean something specific
Read the links above and learn what is cron, it's a basic knowledge in Lunux world, next adjust per your needs.

PostPosted: Tue May 04, 2010 11:42 am
by jack bauer
okli wrote:
jack bauer wrote:
okli wrote:Don't you have similar lines in your crontab?

Code: Select all
### VICIDIAL clean ORIG recordings older than 3 days
0 1 * * * /usr/bin/find /var/spool/asterisk/monitorDONE/ORIG -maxdepth 1 -type f -mtime +3 -print | xargs rm -f


I am not sure where I can find this line. can you be more specific??
where should I type this command?? in the server itself? putty???


cron:
http://centos.org/docs/5/html/Deploymen ... tasks.html
http://www.centos.org/docs/4/html/rhel- ... tasks.html
http://www.google.com/search?num=50&hl= ... =&gs_rfai=

To edit:
crontab -e
with this command how long does it take to delete the contents?
Several seconds, depending how many and how large the files are.

does it require server rebooting
No.
the 3 stars (***) in the command line, do they mean something specific
Read the links above and learn what is cron, it's a basic knowledge in Lunux world, next adjust per your needs.


Dear Okli
thank you for the prompt reply and for chapters to consult
it is a huge world I am getting into.
in the meanwhile, is there any possibility I can have the command line to empty the orig file every friday at any given time??, let's say at 01:00 PM???

PostPosted: Wed May 05, 2010 8:19 am
by jack bauer
Guys please, all I need is a simpler way to empty the ORIG file, this cron thing got me confused as I don't have a strong background in IT and especially linux
thanks

PostPosted: Fri May 07, 2010 12:20 am
by ramindia
Hi

in the same way

how can i detele data more than 30days old
like agent logs, call logs

Ram

PostPosted: Sun May 09, 2010 4:30 pm
by gardo
Simplest way to do it manually is running the following command on the server:

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


This will delete all files in /var/spool/asterisk/monitorDONE/ORIG/.

jack bauer wrote:Guys please, all I need is a simpler way to empty the ORIG file, this cron thing got me confused as I don't have a strong background in IT and especially linux
thanks

PostPosted: Sun May 09, 2010 4:31 pm
by gardo
Look and edit for the following entry in your crontab:

### 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
30 0 * * * /usr/bin/find / -maxdepth 1 -name "screenlog.0*" -mtime +4 -print | xargs rm -f


Adapt to your current settings.

ramindia wrote:Hi

in the same way

how can i detele data more than 30days old
like agent logs, call logs

Ram

PostPosted: Mon May 10, 2010 2:45 am
by jack bauer
gardo wrote:Simplest way to do it manually is running the following command on the server:

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


This will delete all files in /var/spool/asterisk/monitorDONE/ORIG/.

jack bauer wrote:Guys please, all I need is a simpler way to empty the ORIG file, this cron thing got me confused as I don't have a strong background in IT and especially linux
thanks


Thank you Gardo, your answer is exactly what I was looking for!!!!

PostPosted: Mon May 10, 2010 8:10 am
by jack bauer
gardo wrote:Simplest way to do it manually is running the following command on the server:

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


This will delete all files in /var/spool/asterisk/monitorDONE/ORIG/.

jack bauer wrote:Guys please, all I need is a simpler way to empty the ORIG file, this cron thing got me confused as I don't have a strong background in IT and especially linux
thanks


Dear Gardo when I tried to do it, this is the message I have
-bash: /bin/rm: Argument list too long
then
-bash: -bash:: command not found

what to do exactly in this case??

PostPosted: Tue May 11, 2010 7:46 am
by jack bauer
Any reply?
Any help??

PostPosted: Wed May 12, 2010 4:25 am
by gardo
Looks like you have tonnes of recording. Hehehe! Try this instead:

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


This will delete the ORIG folder and all it's contents and then recreate just the folder.

PostPosted: Tue May 18, 2010 8:08 am
by jack bauer
thank you Gardo you are my man!!!!

Re: How to empty the ORIG folder?

PostPosted: Sat Jan 05, 2019 1:18 pm
by Ali7003
how to delete only last hour ORIG folder using putty?

Re: How to empty the ORIG folder?

PostPosted: Sat Jan 05, 2019 3:34 pm
by williamconley
Ali7003 wrote:how to delete only last hour ORIG folder using putty?

http://bfy.tw/LdyV

this should provide results showing both "older than" and "in the last", so choose wisely at that point. 8-)