Setup your CRON Script for Ads Factory

Learn how to set up the CRON job for your Classifieds System.

What is CRON? Every quality hosting has a “scheduling system” also known as CRON. The purpose is to run periodically maintenance scripts, that take care of certain jobs needed for your site. It’s like the Task Scheduler on your Home computer, just it runs programs in your hosting account.

Why is a CRON Script needed? Since PHP scripts are triggered just upon visiting the site, there can be that for a longer or shorter period of time there is no visitor to your site. But there could be tasks needed to run at a specific time. For instance, ads must expire on 00:00 hours, and emails must be sent to users involved in this ads. Also Authors must be reminded of the expiring date for their ads.

How do I set up a CRON task ? Please read our general CRON Tutorial!


How do I set up the CRON task needed for Ads Factory?

First edit the file /components/com_adsman/cron_action.php

In Line 3:

define('ADS_CRON_PASSWORD','pass');

put in your password. This is needed in order to avoid allowing other users to run the cron script


then set up a Cron job for 00:00 as described above with the following command:

lynx -accept_all_cookies -dump 'http://[yoursite]/components/com_adsman/cron_action.php?pass=[yourpass]'

Alternative commands are:

wget -O - -q 'http://[yoursite]/components/com_adsman/cron_action.php?pass=[yourpass]'

curl --silent –compressed 'http://[yoursite]/components/com_adsman/cron_action.php?pass=[yourpass]'

Save your cron job, and that’s it!

Further down you can see screenshots from a CPANEL hosting.

Click on CRON jobs: 

Image

Choose Advanced (Unix):

Image

Set up for midnight, with the command from above: 

Image 

Revised "Ads Factory" version 1.0.x