Visit Our UNIX and Linux User Community


hourly kannel log rotation

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat hourly kannel log rotation
# 1  
Old 08-17-2009
Lightbulb hourly kannel log rotation

I need to Change threshold of rotation of kannel logs.
At the moment, Kannel (the SMS gateway system) logs activities in log files which are rotated daily.
Due to high traffic, the logs grow fast every day before they are rotated; meaning that the write speeds while logging slow down due to large log files.
This therefore requires me to change threshold of rotation of Kannel logs from daily to hourly to ensure that Kannel runs faster.
Targ
# 2  
Old 08-17-2009
I am not aware, how to make this possible via kannel.. But the following strikes to me.

Unix system uses logrotate to do the log rotation of the system log files, which will have the entry for each programs in the directory.,
Code:
/etc/logrotate.d

So my suggestion is locate the file that is related to your process, and then edit it as daily to hourly... ( for example: i did for dkpg.log )
Code:
/var/log/dpkg.log {
        daily
        rotate 12
        compress
        delaycompress
        missingok
        notifempty
        create 640 root adm
}

as

Code:
/var/log/dpkg.log {
        hourly
        rotate 12
        compress
        delaycompress
        missingok
        notifempty
        create 640 root adm
}


I hope it helps.....
# 3  
Old 08-18-2009
Quote:
Originally Posted by thegeek
I am not aware, how to make this possible via kannel.. But the following strikes to me.

Unix system uses logrotate to do the log rotation of the system log files, which will have the entry for each programs in the directory.,
Code:
/etc/logrotate.d

So my suggestion is locate the file that is related to your process, and then edit it as daily to hourly... ( for example: i did for dkpg.log )
Code:
/var/log/dpkg.log {
        daily
        rotate 12
        compress
        delaycompress
        missingok
        notifempty
        create 640 root adm
}

as

Code:
/var/log/dpkg.log {
        hourly
        rotate 12
        compress
        delaycompress
        missingok
        notifempty
        create 640 root adm
}


I hope it helps.....
ca one v some thing like this?
/var/log/kannel.access.log /var/log/kannel.usage.log{
hourly
compress
date+H+Mext
maxage 159
rotate 32
missingok
notifempty
delaycompress
create 640 root root
sharedscripts
#Added for enabling process to write onto new logfile.
postrotate
chmod go+w /tmp/sms.log
killall -HUP bearerbox smsbox || true > /dev/null 2 > /dev/null #send HUP signal to reopen new log files after r
otate.
endscript
}
/var/log/kannel.access.log /var/log/kannel.usage.log /tmp/sms.log {
daily
compress
dateext
maxage 159
rotate 32
missingok
notifempty
size +4096k
delaycompress
create 640 root root
sharedscripts
#Added for enabling process to write onto new logfile.
postrotate
chmod go+w /tmp/sms.log
killall -HUP bearerbox smsbox || true > /dev/null 2 > /dev/null #send HUP signal to reopen new log files after r
otate.
endscript
}

---------- Post updated at 05:34 AM ---------- Previous update was at 05:30 AM ----------

Quote:
Originally Posted by Targ
ca one v some thing like this?
/var/log/kannel.access.log /var/log/kannel.usage.log{
hourly
compress
date+H+Mext
maxage 159
rotate 32
missingok
notifempty
delaycompress
create 640 root root
sharedscripts
#Added for enabling process to write onto new logfile.
postrotate
chmod go+w /tmp/sms.log
killall -HUP bearerbox smsbox || true > /dev/null 2 > /dev/null #send HUP signal to reopen new log files after r
otate.
endscript
}
/var/log/kannel.access.log /var/log/kannel.usage.log /tmp/sms.log {
daily
compress
dateext
maxage 159
rotate 32
missingok
notifempty
size +4096k
delaycompress
create 640 root root
sharedscripts
#Added for enabling process to write onto new logfile.
postrotate
chmod go+w /tmp/sms.log
killall -HUP bearerbox smsbox || true > /dev/null 2 > /dev/null #send HUP signal to reopen new log files after r
otate.
endscript
}
@thegeek
What I want is to maintain the daily logrotation but also run te hourly for the logs that fillup fast.

Thank lots.
Targ

Previous Thread | Next Thread
Test Your Knowledge in Computers #250
Difficulty: Easy
MILNET was the name given to a network that split off from ARPANET in 1983 to create an internetwork designated for use by the U.S. Department of Defense.
True or False?

9 More Discussions You Might Find Interesting

1. AIX

Log rotation in PowerHA7

Hi All, I have a situation here ... HACMP is configured with application monitoring script, which is generating messages .... which is running every minute ... And every minute when monitoring script run, one one log file is generating .... and this log file is rotating ... which is rotating... (1 Reply)
Discussion started by: linux.amrit
1 Replies

2. Shell Programming and Scripting

Log rotation script

I have an application that rotate its log once it reaches 100mb and it keeps a total of 24 logs. I am trying to write a script to run daily to tar up the previous day logs files and move them to a different directory. here is a long listing of the logs in the directory: -rw-r--r-- 1 user1 ... (6 Replies)
Discussion started by: e_mikey_2000
6 Replies

3. Solaris

Log rotation

Hi All! I seem to have a problem with log rotation, unless I am doing something wrong, I have type the following command for testing purposes to see if the -s option works but he did not: logadm -w /var/adm/messages -C 8 -c -s 512k -t '/var/adm/messages.$n' -z 1 the file is now at this... (7 Replies)
Discussion started by: fretagi
7 Replies

4. Shell Programming and Scripting

tail and log rotation

Need some suggestion with an old problem form a thread here: https://www.unix.com/shell-programming-scripting/153204-multiple-not-statement-awk.html Since my log is large, I did get help to make a line that splits the log into two partstail -f syslog | awk '!/snmpd|ntpd|reject/{print | "tee... (1 Reply)
Discussion started by: Jotne
1 Replies

5. UNIX for Dummies Questions & Answers

Log Rotation

Hi Guys, Good morning, I just want to know and collect ideas on this one. Regarding rotation of logs as I've observed it's not consistently functioning. I have a server with 8 Partitions, each partition has a dedicated directory for the logs that is needed and I set it every 5mins (300secs) the... (1 Reply)
Discussion started by: rymnd_12345
1 Replies

6. Solaris

Log rotation, twice

hi folk, need advise regarding the log rotation, i have the logadm set at 30 2 * * * /usr/sbin/logadm so it supposed to rotate once per day, but now it rotated twice! but someone my log will rotate at 2:30 AM, but then another 2 hours later, it creates a new and rotate a new log again,... (2 Replies)
Discussion started by: dehetoxic
2 Replies

7. Shell Programming and Scripting

Create log file periodically ex: hourly

Hello, I have a command which runs continuously and creates output to STDOUT. Now, in unix, if I create logging for this command, it would create a single log file and keep on updating. As there is so much data filled in it, I would want to break the log files periodically. In this instance, say... (4 Replies)
Discussion started by: rajkumarme_1
4 Replies

8. Shell Programming and Scripting

log rotation

Hello all. Due to some reason I can not use HUP to rotate needed log files. So I use the standard method: cp $file $file.1 cat /dev/null > $file But if Java application in this time writing the output to $file, in the beginning of it appears many "^@^@^@^@^@^@". How to avoid it? Or how... (6 Replies)
Discussion started by: mirusnet
6 Replies

9. HP-UX

Log rotation on HP-UX

Can anyone post a sample log rotate and archive configuration on HP-UX? I really don't know how to do that... :( (3 Replies)
Discussion started by: untamed
3 Replies

Featured Tech Videos