Free BSD :  newsyslog setup for Hourly log rotate

Posted on 2006-05-26
Last Modified: 2012-05-05
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/     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 ]  
Question by:Nav444
    LVL 6

    Expert Comment

    LVL 61

    Accepted Solution

    It works according to your rules - it never trims log mentioned.
    "man newsyslog.conf" for more information.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    FreeBSD on EC2 FreeBSD ( is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
    About FreeBSD Jails In FreeBSD, jails are a way of doing operating system level virtualization.  The basis of FreeBSD jails is chroot (, which changes the root directory of processes.  As a…
    Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
    In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now