Setting up the Cron Jobs
What is Cron?
Cron is a utilty that allows you to run specific jobs (scripts or commands) at specified times or periodic intervals.
Linux systems use the crontab
utilty to setup cron. This normally requires shell access to the server.
You can also setup the cron job using a web interface if your server has a control panel (eg. cPanel).
On Windows systems you can use the Task Scheduler (schtasks
)
to setup the cron job. Please see the Windows Task Scheduler
section below.
Please contact us if you have difficulty with cron job setup.
RunQ (runq.php) Script
The application processes the lookup queue using the runq.php script. So this should be executed at periodic intervals. You can do this using a cron job.
Here is a sample crontab entry. Remember to replace the path with your actual path to runq.php.
* * * * * php /home/softnik/public_html/wmdsed30/runq.php >/dev/null 2>&1
If you are running on Debian / Ubuntu make sure that ionCube loader is loaded from the CLI version of php.ini (Debian and Ubuntu use multiple php.ini files)
You can also use wget or lynx instead of PHP to run the script. You will neeed to authenticate using the CLI key if you are doing this.
Here is a sample crontab entry. Remember to replace the hostname and path in the URL below with your hostname and installation path.
* * * * * wget -q -O /dev/null "http://www.example.com/wmdsed30/runq.php?key=xxxx" >/dev/null 2>&1
If you use wget or lynx you should also specify a CLI authentication key (CLI Key).
This is available from the Authentication
tab in Application Settings
. Replace
the xxxx in the example above with your CLI key. This is not required when you use
PHP command line.
Please note that the above entries execute the script every minute. This is important because the script needs frequent control to prevent doing too many and / or too less lookups. Every time you execute the above script it will only do a very very small number of optimized lookups and exit quickly.
If the installation folder is password protected using htaccess, use the following (required only for wget / lynx)
* * * * * wget -q -O /dev/null --user xxxxxxx --password 'xxxxxx' "http://www.example.com/wmdsed30/runq.php?key=xxxx" >/dev/null 2>&1
Make sure that you insert the url, username and password accurately.
Here is a crontab entry that uses Lynx instead of wget...
* * * * * lynx -dump http://www.example.com/wmdsed30/runq.php?key=xxxx >/dev/null 2>&1
Enabling automatic domain whois lookups
You can automatically do lookups on domains that haven't been checked recently. To do this, simply add an extra parameter to the runq.php script, like so
http://www.example.com/wmdsed30/runq.php?auto=30The above will add all domains that haven't been checked within the last 30 days to the whois lookup queue.
The following cron job entry
* * * * * wget -q -O /dev/null "http://www.example.com/wmdsed30/runq.php?auto=90">/dev/null 2>&1
OR
* * * * * php /home/softnik/public_html/wmdsed30/runq.php auto=90 >/dev/null 2>&1
will ensure that all your domains are refreshed every 90 days.
Remember to use this wisely. Doing too many lookups will cause your server's outbound IP to get banned. We recommend looking up domains every 60-90 days or so.
Important: Please don't make two separate cron entries for enabling automatic refresh with runq.php. You just need to add the "?auto=xx" to your existing entry for runq.php.
Though you can use the auto
parameter with runq.php
to refresh domains
automatically, it may be better to use the makeq.php
script to queue
domains for lookups because makeq.php
offers finer control.
Please see here for more details.
Windows Systems
If You have installed Watch My Domains SED on a Windows system, you should use the Windows Task Scheduler.