Setting Automating Options

The Automation menu of the Updating tab allows you to configure automated updates for your Logaholic statistics and automated email alerts.

Logaholic’s analysis and reporting depends on consistent updates of your website tracking data to the Logaholic database. You can automate these updates (i.e. without having to click the Update Now button manually), by scheduling the Logaholic update.php script to run at specified time intervals.

If you wish to update your Logaholic statistics automatically


Setting up Automation:
Instructions for Linux
Instructions for Windows
Related Topics:
Updating All Profiles at once
Setting up Email Alerts
Using Update with Advanced Command Line Options


Linux/Unix

On Linux/Unix/Mac OSX, you can automate your Logaholic data updates through a cron job. There are two methods available; Wget (recommended for Self Hosted Editions), and PHP command line (recommended for Service Provider Editions)


Wget Method (recommended for the Self Hosted Edition):

The Wget Method should run on most Linux systems and could by-pass some permission issues.

To incorporate the Wget method, add the following command to your cron jobs, set at the time interval of your choice:

wget -q -O /dev/null [=http://www.your-domain.com/logaholic/update.php?conf=profilename=]

Replace your-domain.com and profilename with the appropriate values.


If you have protected your logaholic directory with a password via a .htaccess file, you’ll need to include the username and password in the URL like this:
http://username:password@www.your-domain.com/logaholic/update.php?conf=profilename

Example line in your crontab file:

50 23 * * * wget -q -O /dev/null “[=http://username:password@www.yourdomain.com/logaholic/update.php?conf=yourprofilename=]”

The example above would start the update process each day at 23:50.

If Wget is not available, we recommend installing it.


PHP command line method (recommended for the Service Provider Edition):

You can also run the Logaholic update.php script from the command line, like this:

cd /the directory/where logaholic is/
php -q update.php profilename

Replace profilename with the name of the logaholic profile you want to update. There is a space between update.php and profilename.

In a single line, the command would look like:

cd /the directory/where logaholic is/;php -q update.php profilename > /dev/null

The php command must be run from within the logaholic directory, which is why the cd command is included prior to executing the update.php script.

An example line in your crontab file would look like:

[=*=]/20 * * * * cd /thedirectory/wherelogaholicis/;php -q update.php profilename > /dev/null

The example above starts the update process every 20 minutes.


Windows

To automate Logaholic updates on windows, you will need to create a scheduled task and download the wget program:

  • Download Wget for Windows at Sourceforge
  • Copy the wget.exe file to c:/windows
  • Go to Start, Control Panel, Scheduled Tasks, Add Scheduled Task, then click Next
  • Click "Browse.." and browse to C:/windows/wget.exe, Open
  • Type "Logaholic" as the name, Daily, then click Next
  • Start Time: 12:00 AM, perform this task Every Day, Start Date: Today's Date, then click Next
  • Enter the username and password then click Next
  • Open advanced properties then click Finish
  • Run: C:/windows/wget.exe -q -O NUL "http://www.whatever.com/logaholic/update.php?conf=Profilename"
  • On the "Schedule" tab, click Advanced
  • [check] Repeat task, and set the schedule you wish.
  • click OK

Change www.whatever.com to the location of the domain you submitted when you licensed Logaholic, this could also be a IP number.

How do I test the wget command on Windows?

Open a command window in your working directory.

Copy and paste into the command window the command line you composed above at *9.

For this test, remove the portions of the command that silence output: -q -O NUL. Your command line will look like this: C:/windows/wget.exe NUL “http://www.whatever.com/logaholic/update.php?conf=Profilename” ENTER

You will see output in the command window indicating that the script is running. When it finishes, a file named “update.php@conf=Profilename” will be created in your working directory, containing a log of the script execution.