Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bcm50 R3 how to delete cdr records 3

Status
Not open for further replies.

gberger

Technical User
Mar 2, 2004
1,326
CA

Would someone know the linux command to delete all the cdr records?
I do have access to Linux using putty and nnsupport account.
Backing up these Bcm's takes longer and longer since we can't uncheck the call detail recording when doing a backup...

Thanks
 
Do you want to remove all CDR or just certain records etc. I don't have the file and folder path at the moment but will try to get it tomorrow.

There is a neat command that will delete the CDR information on a yearly basis.

Firebird Scrambler

Nortel & Avaya Meridian 1 / Succession & BCM / Norstar Programmer

Website = linkedin
 
Once you have logged into the BCM via SSH, Do the following

"su" and then the root password

"cd /var/nn/CDRDataFiles"

"ls -al"

"ls *.2029* | xargs rm -rf"

The last command deletes all records for the year 2029. Just press the arrow up key and change the year and press enter again.
Repeat the task to delete all the years of CDR data that you don't need.

Firebird Scrambler

Nortel & Avaya Meridian 1 / Succession & BCM / Norstar Programmer

Website = linkedin
 
Remember to remove the " when copying the lines of data and the "ls -al" command can be run again at any time whilst in SSH to check what data is still present in that folder. You might want to do a full BCM backup prior to making the changes so that all the CDR data is saved within the backup as it can be restored if needed at a later date.

Once you have done the deletions, do a full backup and the backup size will be much smaller.

If you use the ZOC tool as I prefer this to PuTTY, then I have attached a script that might help.

Firebird Scrambler

Nortel & Avaya Meridian 1 / Succession & BCM / Norstar Programmer

Website = linkedin
 
Morning Brian

I was given the details from a good friend of ours who knows Linux very well.

Here is an extract taken from the word doc guide I wrote a few years ago

############################################################################################

There were over 172200 entries in my BCM system. The last 4 years were my CDR data from when I first installed the system. My BCM system originally had those from the previous customer’s calling history! The same might also be with your database. Unix can't delete them with the normal utility as they are too numerate.

Let's say you have files from 2009? or 2010 you want to wipe? Unix is your friend. Because I only have recent logs now, my examples are for 2013, but just change the date for your scenario.

If you want to look for only the 2013 logs, then enter:

ls -al *.2013* <cr>

You will get a complete list for 2013. Try substituting the 2013 for 2009 etc. If you get a HUGE list, let's count them by using the command

ls -al *.2009* | wc -l
<cr>

1080 <-- you'll get a little number after a few seconds. "wc" is
"Word count" and "-l" means count lines. The "|" means it’s the 'pipe' the output of the first command to the next. This is a clever command to know? That's what makes Unix handy for complex tasks. Do not mix the pipe | up with a capital I or small letter-L. This is the vertical line, near a back-slash on a British keyboard.

Now, if you want to wipe those old darned logs? If they are large in number, the normal delete command "rm" won't do it. It barfs on the amount of input data. So, there's another way, piping the listing to another utility which does what it's told for everything piped to it.

As in the above scenario, let's wipe out the 2009 (or whatever) logs. ENSURE you are in the correct directory: pwd <cr>

/var/nn/CDRDataFiles <-- OK, if we didn't move around, then it’s safe to begin the deletions.

We remove the target files by selecting certain ones, and pushing them to a command to do it: The below will remove all files from the year 2009:

ls *.2009* | xargs rm -rf <cr>

It will take a few seconds.
Check to see if they're gone:

ls *.2009* <cr> <-- and you should get nothing back.

[root@DraytonBCM50V2 CDRDataFiles]# ls *.2009*
ls: *.2009*: No such file or directory

#####################################################################################

I hope this explains your question?.

Firebird Scrambler

Nortel & Avaya Meridian 1 / Succession & BCM / Norstar Programmer

Website = linkedin
 
I used the rm command on my own system and found you need to use the -f option to force delete the files. Otherwise it asks for confirmation on every file. So I ran the following commands after making /var/nn/CDRDataFiles the working directory to delete all CDR records from all years other than 2018;

rm -f *.2015*
rm -f *.2016*
rm -f *.2017*

Now when I enter the ls command it only shows records for the year 2018.

I ran a backup before and after deleting the CDR records. After deleting the years 2015-2017 my backup size went from 5.99mb to 2.65mb. I am still able to see CDR records using the CDR utility, so it looks like all is working as it should.

Brian Cox
Georgia Telephone
 
That worked, a star for both of you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top