Glossary Item Box
Overview
Cron is a service that runs on Unix/Linux servers to schedule the execution of scripts at predetermined intervals.
https://en.wikipedia.org/wiki/Cron
Squirrelcart's cron script is named cron.php and is located inside your squirrelcart/ folder. This script is used to perform scheduled operations. Use of this script is optional. It is only used for certain optional features that require scheduling.
Cron Script Management Page
You can manage your cron script by clicking Tools > Cron Script Management in the control panel menu.
Please note that this page cannot be used to schedule your cron script. See below for information on scheduling the script.
Running the Script
Calling the Script via a Schedule
If your web server supports cron jobs you can create a cron job to call this file:
squirrelcart/cron.php
You will need to use the full operating system path to the file. You can find that in your Squirrelcart control panel on the Cron Job Management page, under "If your web server supports cron jobs".
If you need help scheduling your cron job I'd recommend contacting your web host.
Example for cPanel environment:
If you'd like to run the script once an hour, and the path to the script is /home/example/public_html/squirrelcart/cron.php , this cron command should work for you:
Note that the sc_data/logs/log-cron.txt file must be writable by your server.
If your web server does not support cron jobs you can load the cron script URL via a pseudo cron job using services like SetCronJob.com. Example:
https://www.example.com/squirrelcart/cron.php
Frequency
Squirrelcart limits the number of operations for each script iteration, using the Max Operations setting. Running the cron job a few times a day should be sufficient for most stores. For busy stores, you may wish to run it more often or increase the Max Operations setting.
Running the Script Manually
For testing purposes, you can load the cron script manually using your browser:
The results will be displayed in your browser. These are the same results you can find in the cron script logs mentioned below.
Limiting Run Time and Resource Usage
The Max Operations setting on the Cron Script Management page controls how many operations are processed each time this script is executed. An operation is considered to be any task that might slow the script down (even slightly).
For example, the built-in Cart - Reminder to Complete Order automatic email feature uses the cron script to determine when to send messages. Each email sent is considered one operation. Setting Max Operations to 50 would result in the script exiting after 50 emails have been sent.
Note that the Max Operations setting is cumulative across all features that use the cron script. If Max Operations is set to 50 and one feature uses 30 operations and another uses 20, the cron script will exit after the total of 50 operations has been met.
Logging
Squirrelcart automatically logs information each time the script is called. You can find the log file here:
sc_data/logs/log-cron.txt
You can view this log file by clicking the View Logs button on the Cron Job Management page.
Archiving
When the log file reaches the size specified in the Max Log Size setting on the Cron Job Management page, the log file is archived to this location:
sc_data/logs/log-cron-archive.txt
Only one archive file is kept.
© 2001-2017 Lighthouse Development. All Rights Reserved.