Nav444
asked on
Free BSD : newsyslog setup for Hourly log rotate
Hi,
I am trying to rotate logs every hour using newsyslog
I have following in /etc/newsyslog.conf
# logfilename [owner:group] mode count size when [ZJB] [/pid_file] [sig_num]
/www/logs/access_log 644 30 * * B /www/logs/httpsd.pid 30
and I have following crontab
0 * * * * newsyslog
but it is not rotate logs!
I did restart apache every time I made changes to newsyslog.conf file, but still not working!
When I use @T00 switch for time, it works and rotates every midnight, but what is the switch for every hour?
Please help!
Also is there a way to change the format of logfile name? like force it to create [ access_log.14.1 ] ?
[ which means access log of hour 14, day 1 ]
I am trying to rotate logs every hour using newsyslog
I have following in /etc/newsyslog.conf
# logfilename [owner:group] mode count size when [ZJB] [/pid_file] [sig_num]
/www/logs/access_log 644 30 * * B /www/logs/httpsd.pid 30
and I have following crontab
0 * * * * newsyslog
but it is not rotate logs!
I did restart apache every time I made changes to newsyslog.conf file, but still not working!
When I use @T00 switch for time, it works and rotates every midnight, but what is the switch for every hour?
Please help!
Also is there a way to change the format of logfile name? like force it to create [ access_log.14.1 ] ?
[ which means access log of hour 14, day 1 ]
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://www.onlamp.com/pub/a/bsd/2001/06/14/Big_Scary_Daemons.html