====== Cron Settings ======
Crontab is a system utility that runs programs at specified times. SmartCJ uses cron to add statistics to the database.
If you see "check crontab" in the Main tab, it almost certainly means your cron entry was deleted. It typically looks like this:
*/1 * * * * cd /path_to_scj/bin/; env HTTP_HOST=yourdomain.com /path_to_php/php -q cron.php
where path_to_scj and path_to_php are the corresponding paths on your server.
If you use internal rotation, you also need to add a rotation cron:
*/1 * * * * cd /path_to_scj/bin/; env HTTP_HOST=yourdomain.com /path_to_php/php -q rotation.php
===== If you have many domains =====
If you run multiple copies on one server, distribute the load to prevent them from starting simultaneously. Create a scj.sh file and add all SmartCJ tasks without the asterisk (*). For example:
cd /path_to_scj/bin/; env HTTP_HOST=yourdomain.com /path_to_php/php -q cron.php &
sleep 2
cd /path_to_scj2/bin/; env HTTP_HOST=yourdomain2.com /path_to_php/php -q cron.php &
**The & at the end of each line is required** — it runs the task in the background, allowing the system to move to the next line immediately without waiting for completion. Without the ampersand, crons run sequentially. Since each script can take up to a minute to complete, without the ampersand your tasks won't finish within the one-minute window. Adjust the sleep duration so all crons start within a minute.
Then add this file to your cron. For example:
*/1 * * * * cd /path_to_sh_file/ ; sh scj.sh
**Important:** The total duration of all sleep commands must not exceed one minute (59 seconds maximum). If you have more scripts, reduce the pause durations.
===== Cron.php execution time =====
This script calculates trader priorities and checks traders against ban lists, Alexa rankings, Google Safe Browsing, ban word filters, and creates trader thumbnails. Priority calculations are fast, but checking speed depends on remote sites. For example, when checking a trader's page for ban words, the script makes a request to their server. If the server is slow or down, the script may wait 30 seconds. This wait time doesn't consume CPU — the server simply waits for a response without using resources.