This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
admin_menu:site_setup:cron_jobs:start [2008/10/05 22:19] jonyo created |
admin_menu:site_setup:cron_jobs:start [2014/09/25 16:55] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | {{indexmenu_n> | ||
====== Cron Jobs ====== | ====== Cron Jobs ====== | ||
- | TODO: Finish | + | |
+ | Admin Page: **Site Setup > Cron Jobs** | ||
+ | |||
+ | In the admin panel, it gives the warning: | ||
+ | < | ||
+ | |||
+ | The **reason for the strong warning** is so you come to this page to learn what is needed to change certain settings on the page, specifically what you need to do before switching to //Option B//. Don't let the warning scare you too much though, if you are familiar with setting up cron tasks for your hosting (or your hosting has good instructions for doing so), you should be fine with setting up the basic heartbeat to run once a minute, just use the [[#Manually Run Heartbeat every minute]] example listed in your admin panel for doing so. The main thing, is after you have set it up to use a manual cron task, after about a week or so, be sure to come back to the cron tasks page and look at the //Last Run// time for each of the cron tasks. | ||
+ | |||
+ | ===== How cron tasks work...what a cron task is: ===== | ||
+ | |||
+ | A cron task, with respect to this software, is an individual task that is meant to be run at a specific interval, to do things like closing listings, moving expired listings to the archive table, removing old images, etc. | ||
+ | |||
+ | By default, the software will run the cron tasks by calling the heartbeat every time someone views a page on the client side. The heartbeat can also be called using something called a "cron job", but this requires the ability to use cron jobs on your host. Adding a cron job is usually done through your hosting control panel, or by using telnet or ssh. If you are not sure how to add a cron job on your host, you can safely keep the settings to the default, and the cron tasks will be run automatically for you any time someone views your site. | ||
+ | |||
+ | The " | ||
+ | |||
+ | As we mentioned before, the heartbeat can be called automatically, | ||
+ | |||
+ | It is not recommended to change any of the settings on this page unless you are familiar with using cron jobs, and are able to test to make sure everything is set up correctly. | ||
+ | |||
+ | Cron tasks can either be run using the internal schedule for each task, using the " | ||
+ | |||
+ | ===== Cron Settings ===== | ||
+ | |||
+ | ==== Run " | ||
+ | |||
+ | a. Automatically when page loads (Default) | ||
+ | |||
+ | b. Manually with Cron Job (Requires Manual Server-Side Cron Jobs) | ||
+ | |||
+ | === Option a === | ||
+ | Is recommended for most sites, as it requires no additional configuration on the server side. With this option, every page view on the client side uses javascript to call the heartbeat. | ||
+ | |||
+ | === Option b === | ||
+ | Is for advanced users only, as it requires additional configuration on the server side to set up cron jobs. Using this option turns off the automatic heartbeat on every client side page view, and relies on the heartbeat to be called using a "cron job" set up to run however often you set it to. If you do decide to set up a cron job to run the heartbeat, we recommend setting it to run in 1-5 minute intervals. | ||
+ | |||
+ | If you wish to run each task manually instead of letting the heartbeat decide which tasks to run, you would also select option b to turn of automatic calls to the heartbeat routine. | ||
+ | |||
+ | ==== Cron Security Key: ==== | ||
+ | |||
+ | This is the key that must be used when calling specific tasks to be run using a cron routine, but it is not required when calling the heartbeat routine. | ||
+ | |||
+ | ==== Time before lock removed (Deadlock prevention): | ||
+ | |||
+ | When a task is being called it is " | ||
+ | |||
+ | The "Time before lock removed" | ||
+ | |||
+ | ===== Cron Task Information ===== | ||
+ | ====Available Tasks/ | ||
+ | |||
+ | Lists all of the tasks that are currently in the system, and lists information about each task. Addons can add their own tasks, you can tell it is an addon because the task name will have a ":" | ||
+ | |||
+ | If you are going to run specific tasks using cron jobs (instead of using the built-in heartbeat task), the task name must match one of the tasks listed in this section in your admin, or that task will not be run. | ||
+ | |||
+ | ===== Cron Job Examples: ===== | ||
+ | |||
+ | This section gives examples of cron jobs you may set up, with the site URL and cron key set to match your site. | ||
+ | |||
+ | ==== Manually Run Heartbeat every minute ==== | ||
+ | This is an example of how you would use a cron job to call the heartbeat task, instead of loading the heartbeat task automatically on each page load. If your server does not have the command line browser " | ||
+ | |||
+ | ==== Run the made-up tasks task1 and task2 every Monday at 1AM ==== | ||
+ | This is an example of how to set it up to manually run certain tasks using a cron job, instead of relying on the heartbeat to run the tasks needed. | ||
+ | |||
+ | ==== SSH Command Line Options ==== | ||
+ | |||
+ | Using " | ||
+ | |||
+ | If your server does not have a command line browser, it is also set up to be called using PHP to run it directly on the command line, however this is not guaranteed to work since server configurations can vary widely. | ||
+ | |||
+ | php / | ||
+ | |||
+ | Replace " | ||
+ | |||
+ | =====Are My Cron Routines Running? | ||
+ | |||
+ | To verify if a cron has been run correctly or not, in the admin to go to the following admin tool: | ||
+ | |||
+ | SITE SETUP > CRON JOBS | ||
+ | |||
+ | and look at the times for "last run" on the cron jobs. Make sure that all the cron jobs listed have been run recently. | ||
+ |