Title:
Automating IDX builds with crontab (linux).
Author: Promethyl
Catagory: Best Practices
Date: Monday, July 21 2003
First things first find out what time the files are built every night on your MLS IDX providers FTP site.
In this example, we chose PHP, Linux and 3:58PM. The first number is minute, the second number is hour in the twenty four hour army time format. The rest of the astricts denote day of week and such, which should be unneeded.
Find your PHP program. Type "whereis php". It will let you know where PHP resides.
[mikes@otis mikes]$ whereis php
php: /usr/local/bin/php /usr/local/lib/php.ini /usr/local/lib/php
We chose the first one, as programs are often located in the bin directory.
Create a text file called crontab. Edit it using vi by typing "vi crontab". Hit the insert key on your keyboard. This tells it you want to type in text and type in:
58 15 * * * /usr/local/bin/php www/php/query_idx.php > www/var/log/query_idx.log
Hit escape, the full colon, w and q. This tells it exit insert mode, I have a command: write quit.
This example runs PHP, tells it the location of the IDX program, and dumps the output to the log file.
Type in "crontab crontab". This tells crontab to load the file called crontab which we just created.
Click here for more information on crontab.
Note: This article assumes you have SSH Telnet or plain Telnet access, and crontab access. The steps which involve direct shell access may have to be carried out by your provider. Contact your webpage host for details.