#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2005
    Posts
    155
    Rep Power
    10

    Log Rotation Problem (FreeBSD 5.4)


    My logrotate is not recreating the original log file even though I have that set as the default.

    Here is the config file:
    maillast
    mail root
    nomissingok
    ifempty
    nodelaycompress
    compress
    rotate 10
    weekly

    include /usr/local/etc/logrotate.d

    /var/log/wtmp {
    monthly
    }




    When I force rotation the wtmp file (viewable via last) is replaced with wtmp.1.bz2. That part is good.

    What's not good is that the wtmp file is not recreated which means "last" does not work properly thereafter.

    I suppose as a post rotate command I can touch the.log but i would have to do that for each rotation entry which is a pain in the arse.

    Does anyone have a solution or any ideas?

    Does anyone know if there is a variable i can pass to the post rotate command (for instance: touch $this_file) that i can use as a global default which will recreate the appropriate log file for each rotation?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Oct 2000
    Location
    Back in the real world.
    Posts
    5,966
    Rep Power
    190
    Add "create" to your default options.

    M.

IMN logo majestic logo threadwatch logo seochat tools logo