Thanks for the quick response! I read about logrotate at voip-info.org but I didn't quite understand it. I'm no asterisk/linux expert unfortunately. First of all. What exactly does happen when I run: /usr/sbin/asterisk -rx 'logger rotate' Does it clear the file and create a new one? Can I run this manually without any interruption in the system? And what does the script do? I understand it "rotates" the logs. But does it delete the old files? Where do I put the script? How do I run it? As you can see I'm really a newbie on this. Unfortunately the docs for asterisk are often with the expectation that you know everything... :) Regards, Jan -----Ursprungligt meddelande----- Fr?n: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] F?r Ex Vitorino Skickat: den 8 januari 2007 13:10 Till: Asterisk Users Mailing List - Non-Commercial Discussion ?mne: Re: [asterisk-users] Manage 'full' log file We've been using logrotate without any issue... We're using the below quoted configuration. Notice the invocation of Asterisk's CLI "logger reload" command so as to close the old files and open new ones. Cheers, -- Ex Vito /var/log/asterisk/messages /var/log/asterisk/queue_log /var/log/asterisk/event_log { weekly rotate 52 dateext compress delaycompress nocreate missingok sharedscripts postrotate /usr/sbin/asterisk -rx "logger reload" endscript } _______________________________________________ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
jan.sarin@securia.se schrieb:> Thanks for the quick response! > > I read about logrotate at voip-info.org but I didn't quite understand it. I'm no asterisk/linux expert unfortunately. > > First of all. What exactly does happen when I run: > /usr/sbin/asterisk -rx 'logger rotate' > > Does it clear the file and create a new one? Can I run this manually without any interruption in the system? > > And what does the script do? I understand it "rotates" the logs. But does it delete the old files? Where do I put the script? How do I run it? As you can see I'm really a newbie on this. Unfortunately the docs for asterisk are often with the expectation that you know everything... :) > > Regards, > Jan > > -----Ursprungligt meddelande----- > Fr?n: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] F?r Ex Vitorino > Skickat: den 8 januari 2007 13:10 > Till: Asterisk Users Mailing List - Non-Commercial Discussion > ?mne: Re: [asterisk-users] Manage 'full' log file > > We've been using logrotate without any issue... We're using > the below quoted configuration. Notice the invocation of > Asterisk's CLI "logger reload" command so as to close the > old files and open new ones. > > Cheers, > -- > Ex Vito > > > /var/log/asterisk/messages /var/log/asterisk/queue_log /var/log/asterisk/event_log { > weekly > rotate 52 > dateext > compress > delaycompress > nocreate > missingok > sharedscripts > postrotate > /usr/sbin/asterisk -rx "logger reload" > endscript > } > _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users > _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users > >This script goes into /etc/logrotate.d in a seperate file. It will compress the log weekly and store it in the same directory the original log was in. -- F. Foerster
Super! Thanks! Now I see how the script works a bit more clearly. :) I still don't understand what happens if I run: /usr/sbin/asterisk -rx 'logger rotate' Can I run the above without having the script? What will the command do? Regards, Jan -----Ursprungligt meddelande----- Fr?n: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] F?r Lenz Skickat: den 8 januari 2007 13:13 Till: Asterisk Users Mailing List - Non-Commercial Discussion ?mne: Re: [asterisk-users] Manage 'full' log file Hi Jan, You should use the logrotate in order to delete the log on periodic intervals. This article is meant to do exactly the opposite :) http://astrecipes.net/index.php?n=205 but you get an idea of how to setup log file rotation and how to notify Asterisk that it should open a new file after the log rotation. Hope this helps l. On Mon, 08 Jan 2007 13:00:52 +0100, <jan.sarin@securia.se> wrote:> Hi, > > I need some help on how to manage the "full" log file. It's getting > quite large now and I'd like to clear it. Is there any simple command > for this or should I just delete the file (need to be sure this won't > affect the system). > > Also - how do I keep the log file from growing so large? > > Thanks! > > Regards, > Jan >-- Loway Research - Home of QueueMetrics http://queuemetrics.loway.it _______________________________________________ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users