39.4. Reporting on Schedule

Instead of manually generating a report from a log file, you can use the Webalizer Logfile Analysis module to set up a Cron job that runs Webalizer on a regular basis. A report should generally be refreshed every one or two days, depending on the size of the log file. Because some large logs take a long time to process, refreshing too frequently (such as once per hour) could cause multiple Webalizer processes to be run on the same log file at the same time, which will corrupt the resulting report.

It is generally a good idea to generate a report for the log file from within Webmin at least once before setting up scheduled reporting, so that you can see if it is really working or not. Once you have done that, follow these steps to set up scheduled reporting:

1.
On the module's main page, click on the log file's name. This will bring you to the options form shown in Figure 39.2.

2.
Change the Scheduled report generation field to Enabled, at times chosen below.

3.
Select the times and days on which the log file should be reprocessed from the Minutes, Hours, Days, Months, and Weekdays lists. For each one, you can either choose All to have the report generated every minute, hour, or whatever. Or you can choose Selected to have Webalizer run only at the times or dates selected from the list. To select multiple entries, hold down the Control or Shift keys while clicking. You can also Control-click to deselect entries that have already been chosen.

By default, the log will be processed at midnight every day. If you have multiple reports that are being generated on schedule, try to stagger them so that they are not all run at the same time. For example, in your second report, select 1 as the hour instead of 0 and so on.

4.
Click the Save button to have Webmin create a Cron job for the report. You will be able to see it in the Scheduled Cron Jobs module (covered in Chapter 10), but you should only edit the dates and times here.

To turn off regular report generation for a log file, select Disabled for the Scheduled report generation field. The Cron job will be deleted, but the times and dates at which it was set to run will be remembered so that you can easily enable it again.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.217.145.223