I have to rotate the Master.csv every 5 minutes, on a heavy loaded system. I use cdr-custom. How do I force asterisk to rename the cdr file every 5 mins? Is there a way? Thanks in advance Philip
On Saturday 09 August 2008 01:53:49 Venefax wrote:> I have to rotate the Master.csv every 5 minutes, on a heavy loaded system. > I use cdr-custom. How do I force asterisk to rename the cdr file every 5 > mins? Is there a way?Add to your crontab: */5 * * * * mv /var/spool/asterisk/cdr-custom/Master.csv /var/spool/asterisk/cdr-custom/Master-`date +%Y%m%d-%H%M`.csv (all on one line) -- Tilghman
In article <200808090226.00264.tilghman at mail.jeffandtilghman.com>, Tilghman Lesher <tilghman at mail.jeffandtilghman.com> wrote:> On Saturday 09 August 2008 01:53:49 Venefax wrote: > > I have to rotate the Master.csv every 5 minutes, on a heavy loaded system. > > I use cdr-custom. How do I force asterisk to rename the cdr file every 5 > > mins? Is there a way? > > Add to your crontab: > > */5 * * * * > mv /var/spool/asterisk/cdr-custom/Master.csv /var/spool/asterisk/cdr-custom/Master-`date > +%Y%m%d-%H%M`.csv > (all on one line)You will need to escape the % chars with \ to keep cron happy (as I discovered when I tested my solution before posting :-) Cheers Tony -- Tony Mountifield Work: tony at softins.co.uk - http://www.softins.co.uk Play: tony at mountifield.org - http://tony.mountifield.org
On Sat, Aug 9, 2008 at 2:53 AM, Venefax <venefax at gmail.com> wrote:> I have to rotate the Master.csv every 5 minutes, on a heavy loaded system. I > use cdr-custom. How do I force asterisk to rename the cdr file every 5 mins? > Is there a way?Why do you "have to" rotate the file every 5 minutes? Why not either move it to dev/null if it's not important, or use cdr-odbc /cdr-mysql, etc. if the data is actually worth coming back to mine later? If you do ever actually need to get data back from those files, you're going to have a mess of small files, any of which may have a particular call you're looking for.