ADMIN_archive_log_tables.pl question

All installation and configuration problems and questions

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

ADMIN_archive_log_tables.pl question

Postby airflux » Fri Mar 10, 2017 1:28 pm

Hi guys,
I've a question for someone more skilled than me :)

I'm looking for a way to archive old call logs without deleting them, I've found ADMIN_archive_log_tables.pl script and the related cron that does a lot of things, but I'm not sure that _archive tables works like I think, there something strange too in the script (for me). I suppose that when live tables becomes too big, records need to be moved to _archive tables and stored to read them in reports for a long time. Checking the code I've noticed that _archive tables are trimmed too. Why? They are used just to run reports on differents tables?

I'm talking abount the 4th query in the following sequence trims the call_log_archive table (ADMIN_archive_log_tables.pl file)
1) INSERT IGNORE INTO call_log_archive SELECT * from call_log;
2) DELETE FROM call_log WHERE start_time < '$del_time'
3) optimize table call_log
4) DELETE from call_log_archive where channel LIKE 'Local/9%' and extension not IN('8365','8366','8367','8368','8369','8370','8371','8372','8373','8374') and caller_code LIKE 'V%' and length_in_sec < 75 and start_time < '$del_time'
5) optimize table call_log_archive

then if I run /usr/share/astguiclient/ADMIN_archive_log_tables.pl -months=6 this will delete records older that 6 months from call_log and that is fine, but what appens in call_log_archive? It will contains less records than call_log due due to where conditions?

I can just remove the second delete and reach my goal, but I want to learn more, more, more, then I hope someone will help me :)

Thanks
Vicibox 7.0.2 - V. 2.12-551a Build 160427-1656 - svn 2353 – 3 Dell R610 (1 db+www - 4 sas raid 10, 2 dialers - 2 sas raid 1)
Vicibox 7.0.3 - V. 2.14-585a Build 170114-1356 - svn 2659 – 2 Dell R610 (1 db+www - 4 sas raid 10, 1 dialer - 2 sas raid 1)
airflux
 
Posts: 29
Joined: Fri Nov 07, 2014 12:39 pm

Re: ADMIN_archive_log_tables.pl question

Postby mflorell » Fri Mar 10, 2017 3:03 pm

Something to keep in mind with the log tables in VICIdial, is that the "call_log" table is not the most accurate table to use for logging the calls, in fact, almost none of the reports in VICIdial even use the call_log data. It is mostly used for keeping track of calls as they are being dialed, and optional manual dialing logging. Also, some auto-dial calls are actually double-logged, which is why that specific delete query is there.
mflorell
Site Admin
 
Posts: 18338
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: ADMIN_archive_log_tables.pl question

Postby VFRDavid » Sat Dec 14, 2019 1:11 pm

Mr. Florell...you stated that the call_log tables are used in almost none of the (stock) reports...is this still the case? My call_log_archive is over 40Gb, and I would like to recover that storage space, but do not want to lose any data that doesn't exist elsewhere, without knowing what I am giving up. I could search the source to see where the tables are used, but, if you know the answer off the top of your head (and if anyone would...it'd probably be you), I would get to be lazy...

8)

Thanks for any info you can provide...

David
David
VFRDavid
 
Posts: 69
Joined: Wed Dec 24, 2014 10:48 am
Location: Deerfield Beach, FL

Re: ADMIN_archive_log_tables.pl question

Postby mflorell » Sat Dec 14, 2019 3:32 pm

Yes, that is still the case, feel free to wipe out(or TRUNCATE) your call_log_archive table, because that data is used in almost none of the reports.
mflorell
Site Admin
 
Posts: 18338
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida


Return to Support

Who is online

Users browsing this forum: Bing [Bot] and 102 guests