Hello,
just to add, in 5.8.0 there is also a new module available, file_out which offers custom
logging including file rotation, which might be interested in this case.
Cheers,
Henning
From: Sergio Charrua via sr-users <sr-users(a)lists.kamailio.org>
Sent: Sonntag, 19. Mai 2024 17:23
To: Kamailio (SER) - Users Mailing List <sr-users(a)lists.kamailio.org>
Cc: فرزانه سلطان زاده <f.soltanzade72(a)gmail.com>om>; Sergio Charrua
<sergio.charrua(a)voip.pt>
Subject: [SR-Users] Re: A question about Db_flatstore Module in Kamailio
Hi Farzaneh,
I have a similar script doing log rotation too, and after executing kamcmd, you may remove
the old files (*.temp in your case).
In my case, instead of deleting file, I move them to another folder (to be processed by
the CDR processor) right after executing kamcmd, who will create new cdr files. And it
works great! Just bear in mind that even after renaming the CDR files to *.temp, Kamailio
will still point to the files and keep track of the cdrs....
Docs have a nice article about rotating files:
https://www.kamailio.org/docs/modules/stable/modules/db_flatstore.html#rota…
and also states that:
" Note that at this point Kamailio will still be writing all data into the
renamed files"
HTH,
Sérgio Charrua
On Sun, May 19, 2024 at 1:15 PM فرزانه سلطان زاده via sr-users
<sr-users@lists.kamailio.org<mailto:sr-users@lists.kamailio.org>> wrote:
Hi,
Hope to find you well,
I have a question about the 'db_flatstore' module in Kamailio. Here's my
script for log rotation:
for f in acc_cdrs_*.log; do
mv -- "$f" "${f%.log}.temp"
done
docker exec -it pcscf kamcmd flatstore.k_rotate
rm *.temp
I want to know if the kamcmd command is blocking and the files can be removed after that
or if I should wait for it to be done before removing the renamed files.
Regards,
Farzaneh
__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to
sr-users-leave@lists.kamailio.org<mailto:sr-users-leave@lists.kamailio.org>
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe: