Re: [asterisk-users] cdr-custom/Master.csv rotation
On Sat, Jun 14, 2008 at 08:49:04PM -0700, Darryl Dunkin wrote: It's like asking for directions, and someone tells you to drive, useless. Here is what we do here: Create /etc/logrotate.d/asterisk: /var/log/asterisk/asterisk-verbose /var/log/asterisk/messages /var/log/asterisk/debug /var/log/asterisk/queue_log { daily rotate 7 compress missingok notifempty sharedscripts postrotate /usr/local/bin/log_rot_ast endscript } /usr/local/bin/log_rot_ast contains: #!/bin/sh /usr/sbin/asterisk -rx 'logger reload' /dev/null 21 logger reload rotates logs. But not CSV . That's because the CSV CDR files are not held open. -- Tzafrir Cohen icq#16849755 jabber:[EMAIL PROTECTED] +972-50-7952406 mailto:[EMAIL PROTECTED] http://www.xorcom.com iax:[EMAIL PROTECTED]/tzafrir ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] cdr-custom/Master.csv rotation
On Sun, Jun 15, 2008 at 10:23 AM, Tzafrir Cohen [EMAIL PROTECTED] wrote: On Sat, Jun 14, 2008 at 08:49:04PM -0700, Darryl Dunkin wrote: It's like asking for directions, and someone tells you to drive, useless. Here is what we do here: Create /etc/logrotate.d/asterisk: /var/log/asterisk/asterisk-verbose /var/log/asterisk/messages /var/log/asterisk/debug /var/log/asterisk/queue_log { daily rotate 7 compress missingok notifempty sharedscripts postrotate /usr/local/bin/log_rot_ast endscript } /usr/local/bin/log_rot_ast contains: #!/bin/sh /usr/sbin/asterisk -rx 'logger reload' /dev/null 21 logger reload rotates logs. But not CSV . That's because the CSV CDR files are not held open. If they are not held open, you can can just move them away with mv, next CDR should just write new file. Regards A,tis -- Atis Lezdins, VoIP Project Manager / Developer, [EMAIL PROTECTED] Skype: atis.lezdins Cell Phone: +371 28806004 Cell Phone: +1 800 7300689 Work phone: +1 800 7502835 ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] cdr-custom/Master.csv rotation
Ok, now I'm confused.. logger reload or no logger reload? I want the Master.csv to rotate. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Atis Lezdins Sent: June 15, 2008 6:50 AM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] cdr-custom/Master.csv rotation On Sun, Jun 15, 2008 at 10:23 AM, Tzafrir Cohen [EMAIL PROTECTED] wrote: On Sat, Jun 14, 2008 at 08:49:04PM -0700, Darryl Dunkin wrote: It's like asking for directions, and someone tells you to drive, useless. Here is what we do here: Create /etc/logrotate.d/asterisk: /var/log/asterisk/asterisk-verbose /var/log/asterisk/messages /var/log/asterisk/debug /var/log/asterisk/queue_log { daily rotate 7 compress missingok notifempty sharedscripts postrotate /usr/local/bin/log_rot_ast endscript } /usr/local/bin/log_rot_ast contains: #!/bin/sh /usr/sbin/asterisk -rx 'logger reload' /dev/null 21 logger reload rotates logs. But not CSV . That's because the CSV CDR files are not held open. If they are not held open, you can can just move them away with mv, next CDR should just write new file. Regards A,tis -- Atis Lezdins, VoIP Project Manager / Developer, [EMAIL PROTECTED] Skype: atis.lezdins Cell Phone: +371 28806004 Cell Phone: +1 800 7300689 Work phone: +1 800 7502835 ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] cdr-custom/Master.csv rotation
Yup, drive. Or in Gavin's case Fly. Really appreciate your help, Darryl. Thanks a lot. I'm attempting to use this now as is, but Tzafrir points out that this might not rotate Master.csv in /cdr-custom. In such a case, what would I need to do? Thanks again, Mark. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Darryl Dunkin Sent: June 14, 2008 11:49 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] cdr-custom/Master.csv rotation It's like asking for directions, and someone tells you to drive, useless. Here is what we do here: Create /etc/logrotate.d/asterisk: /var/log/asterisk/asterisk-verbose /var/log/asterisk/messages /var/log/asterisk/debug /var/log/asterisk/queue_log { daily rotate 7 compress missingok notifempty sharedscripts postrotate /usr/local/bin/log_rot_ast endscript } /usr/local/bin/log_rot_ast contains: #!/bin/sh /usr/sbin/asterisk -rx 'logger reload' /dev/null 21 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mark Hamilton Sent: Saturday, June 14, 2008 19:05 To: 'Asterisk Users Mailing List - Non-Commercial Discussion' Subject: Re: [asterisk-users] cdr-custom/Master.csv rotation Gavin, I really do appreciate your one-liner. But is there any more insight into this? I know I have to use Logrotate, but I have no idea how I can actually get it done. I'm going to try and figure it out right now, but for the benefit of the list and archives, it just might be good if solutions could be posted here too. Thanks, Mark. PS: Remember, many people get their answers from mailing list archives. So we'd rather get them solved than getting the same question on the list 3 months later. :) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gavin Henry Sent: June 13, 2008 4:51 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] cdr-custom/Master.csv rotation 2008/6/13 Mark Hamilton [EMAIL PROTECTED]: Hi, How can I rotate /var/log/asterisk/cdr-custom/Master.csv nightly by date? Logrotate on a *nix box. -- http://www.suretecsystems.com/services/openldap/ ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] cdr-custom/Master.csv rotation
While maybe a little too non-cli for some folks, I like to use Webmin's GUI for setting up log rotation. Nice, quick, easy, hard to get it wrong Thanks, Steve Totaro On Sun, Jun 15, 2008 at 11:48 AM, Mark Hamilton [EMAIL PROTECTED] wrote: Yup, drive. Or in Gavin's case Fly. Really appreciate your help, Darryl. Thanks a lot. I'm attempting to use this now as is, but Tzafrir points out that this might not rotate Master.csv in /cdr-custom. In such a case, what would I need to do? Thanks again, Mark. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Darryl Dunkin Sent: June 14, 2008 11:49 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] cdr-custom/Master.csv rotation It's like asking for directions, and someone tells you to drive, useless. Here is what we do here: Create /etc/logrotate.d/asterisk: /var/log/asterisk/asterisk-verbose /var/log/asterisk/messages /var/log/asterisk/debug /var/log/asterisk/queue_log { daily rotate 7 compress missingok notifempty sharedscripts postrotate /usr/local/bin/log_rot_ast endscript } /usr/local/bin/log_rot_ast contains: #!/bin/sh /usr/sbin/asterisk -rx 'logger reload' /dev/null 21 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mark Hamilton Sent: Saturday, June 14, 2008 19:05 To: 'Asterisk Users Mailing List - Non-Commercial Discussion' Subject: Re: [asterisk-users] cdr-custom/Master.csv rotation Gavin, I really do appreciate your one-liner. But is there any more insight into this? I know I have to use Logrotate, but I have no idea how I can actually get it done. I'm going to try and figure it out right now, but for the benefit of the list and archives, it just might be good if solutions could be posted here too. Thanks, Mark. PS: Remember, many people get their answers from mailing list archives. So we'd rather get them solved than getting the same question on the list 3 months later. :) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gavin Henry Sent: June 13, 2008 4:51 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] cdr-custom/Master.csv rotation 2008/6/13 Mark Hamilton [EMAIL PROTECTED]: Hi, How can I rotate /var/log/asterisk/cdr-custom/Master.csv nightly by date? Logrotate on a *nix box. -- http://www.suretecsystems.com/services/openldap/ ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] cdr-custom/Master.csv rotation
Would that help the rotation of Master.csv too? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Steve Totaro Sent: June 15, 2008 11:51 AM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] cdr-custom/Master.csv rotation While maybe a little too non-cli for some folks, I like to use Webmin's GUI for setting up log rotation. Nice, quick, easy, hard to get it wrong Thanks, Steve Totaro On Sun, Jun 15, 2008 at 11:48 AM, Mark Hamilton [EMAIL PROTECTED] wrote: Yup, drive. Or in Gavin's case Fly. Really appreciate your help, Darryl. Thanks a lot. I'm attempting to use this now as is, but Tzafrir points out that this might not rotate Master.csv in /cdr-custom. In such a case, what would I need to do? Thanks again, Mark. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Darryl Dunkin Sent: June 14, 2008 11:49 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] cdr-custom/Master.csv rotation It's like asking for directions, and someone tells you to drive, useless. Here is what we do here: Create /etc/logrotate.d/asterisk: /var/log/asterisk/asterisk-verbose /var/log/asterisk/messages /var/log/asterisk/debug /var/log/asterisk/queue_log { daily rotate 7 compress missingok notifempty sharedscripts postrotate /usr/local/bin/log_rot_ast endscript } /usr/local/bin/log_rot_ast contains: #!/bin/sh /usr/sbin/asterisk -rx 'logger reload' /dev/null 21 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mark Hamilton Sent: Saturday, June 14, 2008 19:05 To: 'Asterisk Users Mailing List - Non-Commercial Discussion' Subject: Re: [asterisk-users] cdr-custom/Master.csv rotation Gavin, I really do appreciate your one-liner. But is there any more insight into this? I know I have to use Logrotate, but I have no idea how I can actually get it done. I'm going to try and figure it out right now, but for the benefit of the list and archives, it just might be good if solutions could be posted here too. Thanks, Mark. PS: Remember, many people get their answers from mailing list archives. So we'd rather get them solved than getting the same question on the list 3 months later. :) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gavin Henry Sent: June 13, 2008 4:51 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] cdr-custom/Master.csv rotation 2008/6/13 Mark Hamilton [EMAIL PROTECTED]: Hi, How can I rotate /var/log/asterisk/cdr-custom/Master.csv nightly by date? Logrotate on a *nix box. -- http://www.suretecsystems.com/services/openldap/ ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] cdr-custom/Master.csv rotation
In my installations, I have total control via Webmin and can create and alter existing log file rotations via an easy to follow GUI. YMMV. Maybe you have a dev box you can try it on? Installation is simple. I recommend putting it on a non-standard port and not using the default username admin. You could also install it but don't have it run as a service. Webmin is nice for a good many things nix, I am a fan. Just secure it as much as possible. Thanks, Steve T On Sun, Jun 15, 2008 at 12:11 PM, Mark Hamilton [EMAIL PROTECTED] wrote: Would that help the rotation of Master.csv too? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Steve Totaro Sent: June 15, 2008 11:51 AM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] cdr-custom/Master.csv rotation While maybe a little too non-cli for some folks, I like to use Webmin's GUI for setting up log rotation. Nice, quick, easy, hard to get it wrong Thanks, Steve Totaro On Sun, Jun 15, 2008 at 11:48 AM, Mark Hamilton [EMAIL PROTECTED] wrote: Yup, drive. Or in Gavin's case Fly. Really appreciate your help, Darryl. Thanks a lot. I'm attempting to use this now as is, but Tzafrir points out that this might not rotate Master.csv in /cdr-custom. In such a case, what would I need to do? Thanks again, Mark. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Darryl Dunkin Sent: June 14, 2008 11:49 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] cdr-custom/Master.csv rotation It's like asking for directions, and someone tells you to drive, useless. Here is what we do here: Create /etc/logrotate.d/asterisk: /var/log/asterisk/asterisk-verbose /var/log/asterisk/messages /var/log/asterisk/debug /var/log/asterisk/queue_log { daily rotate 7 compress missingok notifempty sharedscripts postrotate /usr/local/bin/log_rot_ast endscript } /usr/local/bin/log_rot_ast contains: #!/bin/sh /usr/sbin/asterisk -rx 'logger reload' /dev/null 21 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mark Hamilton Sent: Saturday, June 14, 2008 19:05 To: 'Asterisk Users Mailing List - Non-Commercial Discussion' Subject: Re: [asterisk-users] cdr-custom/Master.csv rotation Gavin, I really do appreciate your one-liner. But is there any more insight into this? I know I have to use Logrotate, but I have no idea how I can actually get it done. I'm going to try and figure it out right now, but for the benefit of the list and archives, it just might be good if solutions could be posted here too. Thanks, Mark. PS: Remember, many people get their answers from mailing list archives. So we'd rather get them solved than getting the same question on the list 3 months later. :) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gavin Henry Sent: June 13, 2008 4:51 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] cdr-custom/Master.csv rotation 2008/6/13 Mark Hamilton [EMAIL PROTECTED]: Hi, How can I rotate /var/log/asterisk/cdr-custom/Master.csv nightly by date? Logrotate on a *nix box. -- http://www.suretecsystems.com/services/openldap/ ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ -- Bandwidth
Re: [asterisk-users] cdr-custom/Master.csv rotation
Mark Hamilton schrieb: I'm attempting to use this now as is, but Tzafrir points out that this might not rotate Master.csv in /cdr-custom. In such a case, what would I need to do? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Darryl Dunkin Sent: June 14, 2008 11:49 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] cdr-custom/Master.csv rotation It's like asking for directions, and someone tells you to drive, useless. Here is what we do here: Create /etc/logrotate.d/asterisk: /var/log/asterisk/asterisk-verbose /var/log/asterisk/messages /var/log/asterisk/debug /var/log/asterisk/queue_log { daily rotate 7 compress missingok notifempty sharedscripts postrotate /usr/local/bin/log_rot_ast endscript } /usr/local/bin/log_rot_ast contains: #!/bin/sh /usr/sbin/asterisk -rx 'logger reload' /dev/null 21 logrotate can be used to rotate any files you want. So just add a logrotate definition to /etc/logrotate.d/asterisk: /path/to/my/cdr-custom/Master.csv { daily rotate 7 compress missingok notifempty } Grüße, Philipp Kempgen -- http://www.das-asterisk-buch.de - http://www.the-asterisk-book.com Amooma GmbH - Bachstr. 126 - 56566 Neuwied - http://www.amooma.de Geschäftsführer: Stefan Wintermeyer, Handelsregister: Neuwied B14998 ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] cdr-custom/Master.csv rotation
I actually use it on a couple other boxes and I agree with you completely. Just didn't want to use it on this box which I'm trying to keep as secure as possible. I'm a fan of Webmin too. :) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Steve Totaro Sent: June 15, 2008 12:35 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] cdr-custom/Master.csv rotation In my installations, I have total control via Webmin and can create and alter existing log file rotations via an easy to follow GUI. YMMV. Maybe you have a dev box you can try it on? Installation is simple. I recommend putting it on a non-standard port and not using the default username admin. You could also install it but don't have it run as a service. Webmin is nice for a good many things nix, I am a fan. Just secure it as much as possible. Thanks, Steve T On Sun, Jun 15, 2008 at 12:11 PM, Mark Hamilton [EMAIL PROTECTED] wrote: Would that help the rotation of Master.csv too? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Steve Totaro Sent: June 15, 2008 11:51 AM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] cdr-custom/Master.csv rotation While maybe a little too non-cli for some folks, I like to use Webmin's GUI for setting up log rotation. Nice, quick, easy, hard to get it wrong Thanks, Steve Totaro On Sun, Jun 15, 2008 at 11:48 AM, Mark Hamilton [EMAIL PROTECTED] wrote: Yup, drive. Or in Gavin's case Fly. Really appreciate your help, Darryl. Thanks a lot. I'm attempting to use this now as is, but Tzafrir points out that this might not rotate Master.csv in /cdr-custom. In such a case, what would I need to do? Thanks again, Mark. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Darryl Dunkin Sent: June 14, 2008 11:49 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] cdr-custom/Master.csv rotation It's like asking for directions, and someone tells you to drive, useless. Here is what we do here: Create /etc/logrotate.d/asterisk: /var/log/asterisk/asterisk-verbose /var/log/asterisk/messages /var/log/asterisk/debug /var/log/asterisk/queue_log { daily rotate 7 compress missingok notifempty sharedscripts postrotate /usr/local/bin/log_rot_ast endscript } /usr/local/bin/log_rot_ast contains: #!/bin/sh /usr/sbin/asterisk -rx 'logger reload' /dev/null 21 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mark Hamilton Sent: Saturday, June 14, 2008 19:05 To: 'Asterisk Users Mailing List - Non-Commercial Discussion' Subject: Re: [asterisk-users] cdr-custom/Master.csv rotation Gavin, I really do appreciate your one-liner. But is there any more insight into this? I know I have to use Logrotate, but I have no idea how I can actually get it done. I'm going to try and figure it out right now, but for the benefit of the list and archives, it just might be good if solutions could be posted here too. Thanks, Mark. PS: Remember, many people get their answers from mailing list archives. So we'd rather get them solved than getting the same question on the list 3 months later. :) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gavin Henry Sent: June 13, 2008 4:51 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] cdr-custom/Master.csv rotation 2008/6/13 Mark Hamilton [EMAIL PROTECTED]: Hi, How can I rotate /var/log/asterisk/cdr-custom/Master.csv nightly by date? Logrotate on a *nix box. -- http://www.suretecsystems.com/services/openldap/ ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com
Re: [asterisk-users] cdr-custom/Master.csv rotation
That works, thanks a lot! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Philipp Kempgen Sent: June 15, 2008 12:35 PM To: Asterisk Users Subject: Re: [asterisk-users] cdr-custom/Master.csv rotation Mark Hamilton schrieb: I'm attempting to use this now as is, but Tzafrir points out that this might not rotate Master.csv in /cdr-custom. In such a case, what would I need to do? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Darryl Dunkin Sent: June 14, 2008 11:49 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] cdr-custom/Master.csv rotation It's like asking for directions, and someone tells you to drive, useless. Here is what we do here: Create /etc/logrotate.d/asterisk: /var/log/asterisk/asterisk-verbose /var/log/asterisk/messages /var/log/asterisk/debug /var/log/asterisk/queue_log { daily rotate 7 compress missingok notifempty sharedscripts postrotate /usr/local/bin/log_rot_ast endscript } /usr/local/bin/log_rot_ast contains: #!/bin/sh /usr/sbin/asterisk -rx 'logger reload' /dev/null 21 logrotate can be used to rotate any files you want. So just add a logrotate definition to /etc/logrotate.d/asterisk: /path/to/my/cdr-custom/Master.csv { daily rotate 7 compress missingok notifempty } Grüße, Philipp Kempgen -- http://www.das-asterisk-buch.de - http://www.the-asterisk-book.com Amooma GmbH - Bachstr. 126 - 56566 Neuwied - http://www.amooma.de Geschäftsführer: Stefan Wintermeyer, Handelsregister: Neuwied B14998 ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] cdr-custom/Master.csv rotation
On Sunday 15 June 2008 10:46:18 Mark Hamilton wrote: Ok, now I'm confused.. logger reload or no logger reload? I want the Master.csv to rotate. Don't. A 'mv' is enough. This is also the case for any of the CDR csv files, not just Master.csv. -- Tilghman ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] cdr-custom/Master.csv rotation
On Sun, Jun 15, 2008 at 11:46:18AM -0400, Mark Hamilton wrote: Ok, now I'm confused.. logger reload or no logger reload? I want the Master.csv to rotate. If you use the same logrotate file for both the logs and Master.csv, it should have a 'logger reload' line, as you must re-open the logs. E.g: /etc/logrotate.d/asterisk /var/log/asterisk/debug /var/log/asterisk/messages /var/log/asterisk/full /var/log/asterisk/*_log /var/log/asterisk/cdr-*/Master.csv { missingok sharedscripts postrotate asterisk -rx logger rotate /dev/null 21 endscript } But if you have different configuration for the CSV file (e.g: rotate it by size as well, or daily, unlike the system default, which is weekly), you can put it in a separate logrotate file, that will not rotate logs. E.g: /var/log/asterisk/debug /var/log/asterisk/messages /var/log/asterisk/full /var/log/asterisk/*_log { missingok sharedscripts postrotate asterisk -rx logger rotate /dev/null 21 endscript } /var/log/asterisk/cdr-*/Master.csv { daily missingok sharedscripts } -- Tzafrir Cohen icq#16849755 jabber:[EMAIL PROTECTED] +972-50-7952406 mailto:[EMAIL PROTECTED] http://www.xorcom.com iax:[EMAIL PROTECTED]/tzafrir ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] cdr-custom/Master.csv rotation
On Sun, Jun 15, 2008 at 01:50:29PM +0300, Atis Lezdins wrote: If they are not held open, you can can just move them away with mv, next CDR should just write new file. You can. logrotate just automates this 'mv'. It will optionally also compress older log files. And purge even older ones. It can also avoid the 'mv' if there was no change. Or rotate by size and not just by time (it is typically run from a daily cron job). In other words, it is a fire and forget tool. Naturally you can build one on your own. -- Tzafrir Cohen icq#16849755 jabber:[EMAIL PROTECTED] +972-50-7952406 mailto:[EMAIL PROTECTED] http://www.xorcom.com iax:[EMAIL PROTECTED]/tzafrir ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] cdr-custom/Master.csv rotation
2008/6/15 Mark Hamilton [EMAIL PROTECTED]: Yup, drive. Or in Gavin's case Fly. Really appreciate your help, Darryl. Thanks a lot. Sorry, sometime I presume people just need a pointer in the right direction. I should have said have a look at /etc/logrotate.* files on a GNU/Linux box and copy one. Then if you got stuck I coudl have done a copy and paste for you. I'm attempting to use this now as is, but Tzafrir points out that this might not rotate Master.csv in /cdr-custom. In such a case, what would I need to do? Thanks again, Mark. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Darryl Dunkin Sent: June 14, 2008 11:49 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] cdr-custom/Master.csv rotation It's like asking for directions, and someone tells you to drive, useless. Here is what we do here: Create /etc/logrotate.d/asterisk: /var/log/asterisk/asterisk-verbose /var/log/asterisk/messages /var/log/asterisk/debug /var/log/asterisk/queue_log { daily rotate 7 compress missingok notifempty sharedscripts postrotate /usr/local/bin/log_rot_ast endscript } /usr/local/bin/log_rot_ast contains: #!/bin/sh /usr/sbin/asterisk -rx 'logger reload' /dev/null 21 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mark Hamilton Sent: Saturday, June 14, 2008 19:05 To: 'Asterisk Users Mailing List - Non-Commercial Discussion' Subject: Re: [asterisk-users] cdr-custom/Master.csv rotation Gavin, I really do appreciate your one-liner. But is there any more insight into this? I know I have to use Logrotate, but I have no idea how I can actually get it done. I'm going to try and figure it out right now, but for the benefit of the list and archives, it just might be good if solutions could be posted here too. Thanks, Mark. PS: Remember, many people get their answers from mailing list archives. So we'd rather get them solved than getting the same question on the list 3 months later. :) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gavin Henry Sent: June 13, 2008 4:51 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] cdr-custom/Master.csv rotation 2008/6/13 Mark Hamilton [EMAIL PROTECTED]: Hi, How can I rotate /var/log/asterisk/cdr-custom/Master.csv nightly by date? Logrotate on a *nix box. -- http://www.suretecsystems.com/services/openldap/ ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users -- http://www.suretecsystems.com/services/openldap/ ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] cdr-custom/Master.csv rotation
2008/6/15 Darryl Dunkin [EMAIL PROTECTED]: It's like asking for directions, and someone tells you to drive, useless. It's not useles. What will he learn by just copying and pasting below? The first thing I would have done if I got a reply that said just logrotate is Google for it and then read it's man page. Here is what we do here: Create /etc/logrotate.d/asterisk: /var/log/asterisk/asterisk-verbose /var/log/asterisk/messages /var/log/asterisk/debug /var/log/asterisk/queue_log { daily rotate 7 compress missingok notifempty sharedscripts postrotate /usr/local/bin/log_rot_ast endscript } /usr/local/bin/log_rot_ast contains: #!/bin/sh /usr/sbin/asterisk -rx 'logger reload' /dev/null 21 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mark Hamilton Sent: Saturday, June 14, 2008 19:05 To: 'Asterisk Users Mailing List - Non-Commercial Discussion' Subject: Re: [asterisk-users] cdr-custom/Master.csv rotation Gavin, I really do appreciate your one-liner. But is there any more insight into this? I know I have to use Logrotate, but I have no idea how I can actually get it done. I'm going to try and figure it out right now, but for the benefit of the list and archives, it just might be good if solutions could be posted here too. Thanks, Mark. PS: Remember, many people get their answers from mailing list archives. So we'd rather get them solved than getting the same question on the list 3 months later. :) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gavin Henry Sent: June 13, 2008 4:51 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] cdr-custom/Master.csv rotation 2008/6/13 Mark Hamilton [EMAIL PROTECTED]: Hi, How can I rotate /var/log/asterisk/cdr-custom/Master.csv nightly by date? Logrotate on a *nix box. -- http://www.suretecsystems.com/services/openldap/ ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users -- http://www.suretecsystems.com/services/openldap/ ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] cdr-custom/Master.csv rotation
Gavin, I really do appreciate your one-liner. But is there any more insight into this? I know I have to use Logrotate, but I have no idea how I can actually get it done. I'm going to try and figure it out right now, but for the benefit of the list and archives, it just might be good if solutions could be posted here too. Thanks, Mark. PS: Remember, many people get their answers from mailing list archives. So we'd rather get them solved than getting the same question on the list 3 months later. :) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gavin Henry Sent: June 13, 2008 4:51 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] cdr-custom/Master.csv rotation 2008/6/13 Mark Hamilton [EMAIL PROTECTED]: Hi, How can I rotate /var/log/asterisk/cdr-custom/Master.csv nightly by date? Logrotate on a *nix box. -- http://www.suretecsystems.com/services/openldap/ ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] cdr-custom/Master.csv rotation
It's like asking for directions, and someone tells you to drive, useless. Here is what we do here: Create /etc/logrotate.d/asterisk: /var/log/asterisk/asterisk-verbose /var/log/asterisk/messages /var/log/asterisk/debug /var/log/asterisk/queue_log { daily rotate 7 compress missingok notifempty sharedscripts postrotate /usr/local/bin/log_rot_ast endscript } /usr/local/bin/log_rot_ast contains: #!/bin/sh /usr/sbin/asterisk -rx 'logger reload' /dev/null 21 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mark Hamilton Sent: Saturday, June 14, 2008 19:05 To: 'Asterisk Users Mailing List - Non-Commercial Discussion' Subject: Re: [asterisk-users] cdr-custom/Master.csv rotation Gavin, I really do appreciate your one-liner. But is there any more insight into this? I know I have to use Logrotate, but I have no idea how I can actually get it done. I'm going to try and figure it out right now, but for the benefit of the list and archives, it just might be good if solutions could be posted here too. Thanks, Mark. PS: Remember, many people get their answers from mailing list archives. So we'd rather get them solved than getting the same question on the list 3 months later. :) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gavin Henry Sent: June 13, 2008 4:51 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] cdr-custom/Master.csv rotation 2008/6/13 Mark Hamilton [EMAIL PROTECTED]: Hi, How can I rotate /var/log/asterisk/cdr-custom/Master.csv nightly by date? Logrotate on a *nix box. -- http://www.suretecsystems.com/services/openldap/ ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] cdr-custom/Master.csv rotation
Hi, How can I rotate /var/log/asterisk/cdr-custom/Master.csv nightly by date? Thanks, Mark ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] cdr-custom/Master.csv rotation
2008/6/13 Mark Hamilton [EMAIL PROTECTED]: Hi, How can I rotate /var/log/asterisk/cdr-custom/Master.csv nightly by date? Logrotate on a *nix box. -- http://www.suretecsystems.com/services/openldap/ ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users