grashoper has asked for the wisdom of the Perl Monks concerning the following question:

I am looking for a method of setting IIS logfiles to truncate after 60 days, I would like to stop IIS (at midnight) zip&email the logfile, delete it and finally restart iis to create a new one, is there anything in place that might help do something like this?

Replies are listed 'Best First'.
Re: Logfiles for IIS
by grep101 (Initiate) on Nov 13, 2008 at 03:55 UTC
    60 days? I would suggest fix size truncation.

    But if you insist, you could do:
    0. set the log size to unlimited.

    And every 60 days your script should:
    1. iisreset /stop
    2. do your thing with the log
    3. iisreset /start
Re: Logfiles for IIS
by bingos (Vicar) on Nov 13, 2008 at 11:52 UTC

    With IIS you can specify whether you want Hourly, Daily, Weekly, Monthly, Unlimited or Limited by size. The first four will rotate automatically for you with no need to stop IIS.

    Personally, I set it for daily.

    A sixty day logfile is going to be huge, depending on the server load, even zipped. Better to go with daily, weekly or monthly, no?

      Hi,

      I didn't know that you're using IIS... };-)

      Regards,

      fmerges at irc.freenode.net