# CRON Job Files

##### <span style="color: #ba372a;">**Cron Jobs**</span>

**Cron** is a time-based job scheduler. A scheduled job is known as a *cron job*. <sup class="reference" id="bkmrk-"></sup><sup class="reference" id="bkmrk--0"></sup><sup class="reference" id="bkmrk--1"></sup><sup class="reference" id="bkmrk--2"></sup>Although typically used to automate system maintenance and administration it can be used to automate any task. Cron is most suitable for scheduling repetitive tasks. These are scripts that are set to run at selected times (day, week, month). The desired time and frequency is set using the site cPanel.

Because the 'jobs' are scheduled and run via the main cPanel the files are placed in the main file structure. Some of the primary Cron files are:

1. **Missing Images** - Provides a list of all Memorial records that reference an image file but the file cannot be located in the images/cem\_images directory. This should be scheduled to run weekly.
2. **Not Used Images** - This is the reverse of *Missing Images*. This provides a list of all images in the images/cem\_images directory that are not referenced in any Memorial record. This should be scheduled to run weekly.
3. **Missing GPS** - Searches all images/cem\_images directories for image files that contain GPS coordinates. For such records the memorial record is ??? This should be scheduled to run weekly.
4. **Missing Credits** - Provides a list of all Memorial records that contain image references but do no include a reference to the person credited for providing the image. This should be scheduled to run weekly.
5. **Sitemap** - Provides a series of .xml files used by bots that crawl websites to gather page results for SEO (<span class="gs_tkn show">Search </span><span class="gs_tkn show">Engine </span><span class="gs_tkn show">Optimization) </span>statistics. The module uses the *County*\_search.json file to produce the *sitemap* directory files. This is run on the first day of each month.

Cron Jobs that create a 'report' send an email to the County Coordinator. Additionally, the Admin area contains links to each report so Admin level users can generate a report as desired. These requests will display the report results in the user's browser.

##### <span style="color: #ba372a;">**Scheduled Run Time**</span>

Depending on the number of Memorial records, it may take several minutes for some of the Cron Job to finish. Thus, it is best to schedule the 'jobs' at a low traffic period. Early morning (1-2 a.m.) is a good window to schedule. Additionally, some time during the hour rather than just on the hour (e.g., 1:18 a.m.). Further, for a job scheduled once a week, Monday morning is a good time.