phpJobScheduler - README |
phpJobScheduler is designed to automate tasks by
scheduling PHP scripts to run at set intervals.
This version runs silently (no screen output) but saves the output, including any errors,
to the database.
Full details can be found at: www.phpjobscheduler.co.uk
Requirements:
Index:
To upgrade an existing installation: there are TWO main points to note!
Your existing scheduled tasks, if any exist,
will remain unchanged within your database.
Also, you can retain your existing config file: /phpjobscheduler/pjsfiles/config.inc.php
If you have previously made changes to: /phpjobscheduler/pjsfiles/constants.inc.php
then you will need to make those changes again as this file now contains
many new constants.
When you have followed the details below (To complete a new
installation) you MUST login to check your scheduled tasks, by
doing so it will automatically update your database and add the required new fields to the
tables as required.
To complete a new installation:
<?php include( dirname(__FILE__) . "/phpjobscheduler/firepjs.php"); ?>
The above HTML can be added to any web page on any website (not just to the site where phpJobScheduler is installed). Adding this code will add a very small clear image to your page - invisible (unless you know its there). Execution is very quick so will not slow the loading of any pages.
If you have correctly completed the above the following tables will be created in your database database:
phpJobScheduler
phpJobScheduler_log
Error log - recording of runs and errors of each fired task.
Recorded data: date of last run, and url including errors if any occur. If "Output:" has no data then this means the script ran without errors or output.
By default error logging is turned on (TRUE). To turn on/off error logs:
Change the value assigned to ERROR_LOG within the /pjsfiles/constants.inc.php file. Change the value to FALSE to stop logging. It will not affect the running of fired scripts if you turn off error logging.
The output is truncated to a maximum length of 1200 characters by default to ensure the logs table does not become too large. You can change this by editing the constant MAX_ERROR_LOG_LENGTH within the constants.inc.php file.
Altering the time frame window
This can be changed by altering the value assigned to TIME_WINDOW within the /pjsfiles/constants.inc.php file. The default value is 3600 seconds (60 minutes which should suffice for most sites). This means that when the firing engine (phpjobscheduler/firepjs.php) is called any scheduled job having a fire time within 60 minutes will be executed.
You can increase or decrease the default value of the time frame window. If your site receives just a few hits per day you should consider increasing the value to 43200 (12 hours).
If your site ALWAYS receives several hits per hour or more then you should consider reducing the value to suit your needs.
NEED more help? Try the forum
DEBUG
When you are happy all is running without error set DEBUG to false, edit the file:
/phpjobscheduler/pjsfiles/config.inc.php
This will then prevent any output - so when you call firejps.php it will run silently.
Launch Date: 14th Oct 2003
Version and description of changes
- 1.0 14th Oct 2003 Original release
- 3.0 Nov 2005 Released under GPL/GNU
- 3.1 June 2006 Fixed modify issues, and other minor issues
- 3.3 Dec 2006 removed bugs/improved code
- 3.4 Nov 2007 AJAX, and improved script including using CURL and fsockopen
- 3.5 Dec 2008 Improvements, including single fire, silent db connect, fire time in minutes
- 3.6 Oct 2009 Version check added
- 3.7 Feb 2011 - DEBUG improved to aid install, and new method added to ensure only one instance of the same script runs at any one time
- 3.8 April 2012 - Corrected issue stopping the database updating and logs being saved when a schedule was fired. Also, amended the db structure to ensure logs are saved when two or more schedules run at the same time.
- 3.9 April 2014 - Improved database connectivity now using PDO, the old PHP MySQL functions (eg. mysql_connect) have gone. Also the ability to Pause scripts has been added.
phpJobScheduler IS PROVIDED "AS IS" WITHOUT REPRESENTATION OR WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY REPRESENTATIONS OR ENDORSEMENTS REGARDING THE USE OF, THE RESULTS OF, OR PERFORMANCE OF THE INFORMATION, ITS APPROPRIATENESS, ACCURACY, RELIABILITY, OR CORRECTNESS.
THE ENTIRE RISK AS TO THE USE OF phpJobScheduler IS ASSUMED BY THE USER. IN NO EVENT I BE LIABLE FOR ANY DAMAGES, DIRECT, INDIRECT, INCIDENTAL OR CONSEQUENTIAL, RESULTING FROM ANY DEFECT IN phpJobScheduler, EVEN IF THE POSSIBILITY OF SUCH DAMAGES HAS BEEN ADVISED. THIS DISCLAIMER SHALL SUPERSEDE ANY VERBAL OR WRITTEN STATEMENT TO THE CONTRARY. IF YOU DO NOT ACCEPT THESE TERMS YOU MUST CEASE AND DESIST USING phpJobScheduler IMMEDIATELY.