SCRIPT DELETE

Any and all non-support discussions

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

SCRIPT DELETE

Postby ruben23 » Tue Jan 29, 2013 11:10 pm

Multi Server- 2DBRelication M/S(HA,HearBeat/MON),Web(Proxmox_VMs-LoadBalance),3-telephony
ASterisk 1.4.27-vici
Dahdi-current
2.4 svntrunk
Ubuntu server 10.04 LTS
Scracth Install
VERSION: 2.6
© 2012 ViciDial Group

Hi guys any have idea this script is not performing and running somehow to clean up recordings:

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


any idea how modification to make it work somehow.Thanks
SkypeID: rlacumba
IBM x3200 Dual Core 2.4 Ghz.
4GB Ram
VERSION: 2.4-311a
BUILD: 110514-1351
© 2011 ViciDial Group
Asterisk 1.4.27-vici
Another VICI_day, same trunK, same Channel-->Transcode...
ruben23
 
Posts: 1161
Joined: Thu Jul 31, 2008 10:35 am
Location: Davao City, Philippines

Re: SCRIPT DELETE

Postby williamconley » Tue Jan 29, 2013 11:38 pm

what makes you believe it is not working?
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: SCRIPT DELETE

Postby ruben23 » Wed Jan 30, 2013 12:41 am

@ williamconley

my recordings are increasing its size with same level of call rate and also the dates suppose to be deleted are still available on that directory.
SkypeID: rlacumba
IBM x3200 Dual Core 2.4 Ghz.
4GB Ram
VERSION: 2.4-311a
BUILD: 110514-1351
© 2011 ViciDial Group
Asterisk 1.4.27-vici
Another VICI_day, same trunK, same Channel-->Transcode...
ruben23
 
Posts: 1161
Joined: Thu Jul 31, 2008 10:35 am
Location: Davao City, Philippines

Re: SCRIPT DELETE

Postby williamconley » Wed Jan 30, 2013 1:04 am

your recordings are increasing in size: can you demonstrate this? also remember that this command only deletes the recordings from the orig folder, because they are redundant. there are recordings in other folders that are not deleted and that will cause the monitorDONE folder to continually increase until you make a change to delete/move, etc the other folders in monitorDONE.

How old are the files in the /orig/ folder? At most, how many days?
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: SCRIPT DELETE

Postby ruben23 » Wed Jan 30, 2013 2:12 am

@williamconley

Yes, my ORIG directory did increased in size and my MP3 are somehow NFS share to my NAS server, so the problem only is my ORIG file which i intend to be maintained by that cronjobs command..i see files on my ORIG month old already suppost it would clean up every 5 days old.
SkypeID: rlacumba
IBM x3200 Dual Core 2.4 Ghz.
4GB Ram
VERSION: 2.4-311a
BUILD: 110514-1351
© 2011 ViciDial Group
Asterisk 1.4.27-vici
Another VICI_day, same trunK, same Channel-->Transcode...
ruben23
 
Posts: 1161
Joined: Thu Jul 31, 2008 10:35 am
Location: Davao City, Philippines

Re: SCRIPT DELETE

Postby DomeDan » Wed Jan 30, 2013 5:15 am

Start by log in as root and check your system mail with the command "mail", because if theres errors from that command they will be there
or you can just run the command in question and see what the output is.

I had a problem when that command failed because a few files had space in their name,
I added --delimiter=\\n to the xargs command and then it worked with those files, I also posted a patch to the issue tracker to prevent agents to add space to phone_number

this is the command you can run if you have some files with space in their name:
/usr/bin/find /var/spool/asterisk/monitorDONE/ORIG/ -maxdepth 2 -type f -mtime +5 -print | xargs --delimiter=\\n rm -f
but you might want to find them first if they havent been converted and archieved because some other command failed because of the space
Vicidial Partner. Region: Sweden/Norway.
Does Vicidial installation, configuration, customization, add-ons, CRM implementation, support, upgrading, network-related, pentesting etc. Remote and onsite assistance.
Email: domedan (at) gmail.com
DomeDan
 
Posts: 1226
Joined: Tue Jan 04, 2011 9:17 am
Location: Sweden

Re: SCRIPT DELETE

Postby williamconley » Wed Jan 30, 2013 2:33 pm

tail -500 /var/log/messages

and

tail -500 /var/mail/root

can both be used to find failures in cron executions

it can also be helpful to simply copy the command and execute it yourself to see if / why it fails.
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: SCRIPT DELETE

Postby ruben23 » Wed Jan 30, 2013 7:30 pm

@ williamconley


i tried running the script directly :

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

Just blank screen nothing happens back to the directory i execute the command same as the modified one you have

/usr/bin/find /var/spool/asterisk/monitorDONE/ORIG/ -maxdepth 2 -type f -mtime +5 -print | xargs --delimiter=\\n rm -f


Ill try to look into the logs you said.Thanks
SkypeID: rlacumba
IBM x3200 Dual Core 2.4 Ghz.
4GB Ram
VERSION: 2.4-311a
BUILD: 110514-1351
© 2011 ViciDial Group
Asterisk 1.4.27-vici
Another VICI_day, same trunK, same Channel-->Transcode...
ruben23
 
Posts: 1161
Joined: Thu Jul 31, 2008 10:35 am
Location: Davao City, Philippines

Re: SCRIPT DELETE

Postby DomeDan » Thu Jan 31, 2013 3:25 am

that's the result when there was no files to be found with that criteria.
check what you got in the ORIG directory, list the 10 oldest files for example:
ls -ltr /var/spool/asterisk/monitorDONE/ORIG/ | head
Vicidial Partner. Region: Sweden/Norway.
Does Vicidial installation, configuration, customization, add-ons, CRM implementation, support, upgrading, network-related, pentesting etc. Remote and onsite assistance.
Email: domedan (at) gmail.com
DomeDan
 
Posts: 1226
Joined: Tue Jan 04, 2011 9:17 am
Location: Sweden

Re: SCRIPT DELETE

Postby ruben23 » Thu Jan 31, 2013 6:56 pm

Code: Select all
root@opendialdvo:~# ls -ltr /var/spool/asterisk/monitorDONE/ORIG/ | head


total 134272456
-rw-r--r-- 1 root root   408364 2013-01-25 06:37 20130125-193652_81046751_halojado_CAPITALH-all.wav
-rw-r--r-- 1 root root  1319404 2013-01-25 06:37 20130125-193555_81046749_halojado_CAPITALH-all.wav
-rw-r--r-- 1 root root  1049004 2013-01-25 06:37 20130125-193612_81046750_halojado_CAPITALH-all.wav
-rw-r--r-- 1 root root   676204 2013-01-25 06:37 20130125-193640_96269115_NSUCAYRE_AVISHSPR-all.wav
-rw-r--r-- 1 root root  1302124 2013-01-25 06:37 20130125-193601_96269072_NSUCAYRE_AVISHSPR-all.wav
-rw-r--r-- 1 root root   739244 2013-01-25 06:37 20130125-193641_97373601_clabita_AVISHS-all.wav
-rw-r--r-- 1 root root  1667884 2013-01-25 06:37 20130125-193543_94899058_clabita_AVISHS-all.wav
-rw-r--r-- 1 root root  1396844 2013-01-25 06:37 20130125-193601_90062357_agilves_AVISHSPR-all.wav
-rw-r--r-- 1 root root  1185004 2013-01-25 06:37 20130125-193615_81051225_sfenol_CAPITALH-all.wav



@ DomeDan Thats the output..Thanks
SkypeID: rlacumba
IBM x3200 Dual Core 2.4 Ghz.
4GB Ram
VERSION: 2.4-311a
BUILD: 110514-1351
© 2011 ViciDial Group
Asterisk 1.4.27-vici
Another VICI_day, same trunK, same Channel-->Transcode...
ruben23
 
Posts: 1161
Joined: Thu Jul 31, 2008 10:35 am
Location: Davao City, Philippines

Re: SCRIPT DELETE

Postby williamconley » Thu Jan 31, 2013 7:33 pm

well, those are very recent files. looks like the delete process is doing it's job.

test with

/usr/bin/find /var/spool/asterisk/monitorDONE/ORIG/ -maxdepth 2 -type f -mtime +3 -print | xargs rm -f

and see if it deletes them to a more recent threshold. but it looks like it's workin'
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: SCRIPT DELETE

Postby ruben23 » Sun Feb 10, 2013 7:41 pm

@ williamconley


Yes coz i already backup it manually using only WINSCP, which is a very lagged process. any other chance we can make this script work..? Thanks


Ruben
SkypeID: rlacumba
IBM x3200 Dual Core 2.4 Ghz.
4GB Ram
VERSION: 2.4-311a
BUILD: 110514-1351
© 2011 ViciDial Group
Asterisk 1.4.27-vici
Another VICI_day, same trunK, same Channel-->Transcode...
ruben23
 
Posts: 1161
Joined: Thu Jul 31, 2008 10:35 am
Location: Davao City, Philippines

Re: SCRIPT DELETE

Postby williamconley » Sun Feb 10, 2013 8:10 pm

i'm not sure i understand the question. it looks like the script is already working. what makes you think it isn't?
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 49 guests

cron