Can you please assist me in writing a script to redirect the output of asterisk -vvvr to a file( I used asterisk -vvvr > filename). With normal commands like tail, I am able to do it. But in the case of asterisk, once the process is started, I am not able to stop it from the script.
Thank you for your reply. The /var/log/asterisk/messages contains the entire log. I just wanted to split it say daily or say upto 5 mb size. The file name should contain time stamp. I am copying my script below.
Wouldn’t it be more efficient just to parse the existing log file from Asterisk and storing the parsed output in separate files? I think doing a couple of grep/sed/awk commands would not be so hard … And you can make this parser script run as a cronjob that is excecuted every night.
Thanks for all your replies. I am a newbie to asterisk. So I don’t have the complete picture. What I just tried was to split the logs into smaller files say 5 MB so that I can store it in a safe location for future reference. I think What dejanst suggested is a nice idea. I will try that definitely