From fe16a9bc245b280c52684575cc9436055d21817e Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Wed, 10 Nov 2010 18:48:57 +0000 Subject: [PATCH] added example config sections; tested ok --- acc-cleanup.conf | 36 +++++++++++++++++++++++++++++++++++- acc-cleanup.pl | 8 ++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/acc-cleanup.conf b/acc-cleanup.conf index 6187e52..15f7c7c 100644 --- a/acc-cleanup.conf +++ b/acc-cleanup.conf @@ -90,4 +90,38 @@ compress = gzip username = root password = 1freibier! -connect accounting +### Example use cases + +# No collector running, clean up old acc entries from kamailio db: +# +# connect kamailio +# time-column = time +# cleanup-days = 90 +# cleanup acc + +# Clean up after mediator by deleting old leftover acc entries and deleting +# old entries out of acc_trash and acc_backup +# +# # with collector: +# connect accounting +# # without collector: +# connect kamailio +# +# time-column = time +# cleanup-days = 30 +# cleanup acc +# cleanup-days = 180 +# cleanup acc_trash +# cleanup acc_backup + +# Create monthly backup tables for CDRs older than 6 months. Dump monthly +# backup tables older than a year to /backup. +# +# connect accounting +# time-column = start_time +# backup-months = 7 +# backup-retro = 3 +# backup cdr +# archive-months = 13 +# archive-target = /backup +# archive cdr diff --git a/acc-cleanup.pl b/acc-cleanup.pl index bac25dc..0a309fc 100755 --- a/acc-cleanup.pl +++ b/acc-cleanup.pl @@ -112,6 +112,14 @@ sub cleanup { my %cmds; +$cmds{unset} = sub { + my ($var) = @_; + + $var or die("Syntax error in unset command"); + + delete($vars{$var}); +}; + $cmds{connect} = sub { my ($db) = @_;