Hi guys, I have noticed that 'logger rotate' command only rotates log files in the /var/log/asterisk directory, but not in the subdirectories. How could I rotate my /var/log/asterisk/cdr-custom/Master.csv log file? Regards, Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20060523/c4518a1c/attachment.htm
On 230506, 10:10, Asterisk wrote:> > I have noticed that 'logger rotate' command only rotates log files in > the /var/log/asterisk directory, but not in the subdirectories. How > could I rotate my /var/log/asterisk/cdr-custom/Master.csv log file?Just create a shell script like this: #!/bin/sh BKPREF="backup_cdr" BKNAME="$BKPREF.`date +%Y.%m.%d.at.%H.%M.%S`" # how to name your files BKPATH="/data/backup" # backup directory mv /var/log/asterisk/cdr-custom/Master.csv ${BKPATH}/${BKNAME} and you're done. -- Massimiliano Stucchi, CTO & Director of Operations WillyStudios.com - IT Consulting, Web and VoIP Services stucchi@willystudios.com | Tel (+39) 0244417203 | Fax (+39) 0244417204 IT-20040, Carnate (Milano), via Carducci 9 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 187 bytes Desc: not available Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20060523/71fd55c0/attachment.pgp
On Tue, 2006-05-23 at 10:10 +0200, Asterisk wrote:> Hi guys, > > > > I have noticed that 'logger rotate' command only rotates log files in > the /var/log/asterisk directory, but not in the subdirectories. How > could I rotate my /var/log/asterisk/cdr-custom/Master.csv log file?I use this script which lives in /etc/logrotate.d/ on my CentOS 4.3 box: /var/log/asterisk/messages /var/log/asterisk/event_log /var/log/asterisk/queue_log /var/log/asterisk/h323_log /var/log/asterisk/cdr-custom/Master.csv { missingok notifempty create 0640 asterisk asterisk sharedscripts postrotate /usr/sbin/asterisk -rx 'logger rotate' >/dev/null 2>/dev/null || true endscript } Regards, Patrick