Skip to content
  • Leigh B. Stoller's avatar
    Fix up genlastlog to avoid Y2K like problems. Basically, syslog does · cb096341
    Leigh B. Stoller authored
    not include a year in the output, so I was using the current year to
    init the tm structure. However, the log file could span from the old
    year to the new year, and so all the dates could be wrong. Using Mac's
    suggestion, look at the final time stamp, and if its in the future,
    reset it back one year.
    
    Also add [-a #] option to roll through the specified number of
    rotation files, to make the job of reinitting all the records easier.
    I ran it as "genlastlog -a 7", which makes it process logins.7.gz
    through logins.0.gz, before doing the current log.
    cb096341