Setup your CRON Script for Auctions Factory

Learn how to set up the CRON job for your Auction 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, auctions must expire on 00:00 hours, and emails must be sent to users involved in this auctions. Also Auctioneers must be reminded of the expiring date for their auctions.

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


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

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

In Line 3:

define('AUCTIONS_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 (Auction Factory 1.4.x users please read also at the bottom the section about new setup for 1.4.x):

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

Alternative commands are:

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

curl --silent –compressed 'http://[yoursite]/components/com_bids/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 

 

FOR AUCTION FACTORY 1.4.x USERS - since 1.4.x expire hour and expire minutes are introduced. Therefor we need to setup two types of cron jobs: daily and every x minutes. The daily job will send out notifications about upcoming finishing auctions and cleanup some databses. The minute job will check expiration of the auctions every x (you decide) minutes. Auction will expire at the time set up for them anyway, just the notifications will be sent through this cron job. So a timeframe of 5 minutes would be sufficient in most cases.

The minute job should be started like this: 

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

and the daily job like this:

lynx -accept_all_cookies -dump 'http://[yoursite]/components/com_bids/cron_action.php?daily=1&pass=[yourpass]'

For any uncertainties please feel free to ask in our forums.

Revised "Auction Factory" version 1.0.x and 1.4.x