Setting up cron-jobs

Cron jobs are used to automate recurring maintenance tasks of your site, like importing feeds every day. Configuring cron jobs is not required to run your site, but it will simplify the day-to-day maintenance. Cron jobs are configured in the admin panel of your hosting environment; please consult the documentation of your provider to see how this is done in your specific case. The command to execute in the cron job can be found in the Server status page of your DF/Manager installation.

Two ways, WGET...

DF/Manager 1.5.0 introduces 2 ways to execute crons. The 'old' way using a wget command works in most cases. The url to the cron command is [yoursite]/cron/run/[secret_key]. The secret_key is generated by the application and prevents random visitors from executing your cron (which can put quite a strain on the database). This command can be called manually in the browser. The down side of this method is that it executes by simply calling a web page. If your web server has a time-out and your cron doesn't finish before it runs out, you're in trouble.

...and CLI

The second method requires a command-line-interface (CLI) build of PHP. This may not be available on all hosting environments. If you run into time-outs during imports, this method will most likely solve them. The execution no longer runs through the web server (Apache, etc.) but runs directly on the server.

CLI permissions

For the CLI command to work you will need to set execute permissions on the following files:

  • /cake/console/cake
  • /app/vendors/shells/dfmshell
  • /app/vendors/shells/maintenance.php
  • /app/vendors/shells/tasks/cron_cleanup.php
  • /app/vendors/shells/tasks/feed_import.php

CLI settings

You need to set your domain name in /app/config/bootstrap.php.

Open the mentioned file and find the part starting with define('MY_DOMAIN', '');

Enter the domain name of the site you're working on between the empty quotes. Enter only the bare domain name, leave www. and http:// out.

If, for instance, your DF/Manager is installed on http://www.bestaffiliateshop.com then you should enter bestaffiliateshop.com.