The Wiki is still in development, please bare with us while we add and update content.

This is an old revision of the document!

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home/sfoyston/public_html/TextStorm/Wiki/inc/parser/handler.php on line 1458

Warning: preg_match(): Compilation failed: invalid range in character class at offset 3093 in /home/sfoyston/public_html/TextStorm/Wiki/inc/parser/lexer.php on line 118
A PCRE internal error occured. This might be caused by a faulty plugin

====== SchedMan Overview ====== SchedMan is a scheduling application developed in PHP to handle automation and scheduled tasks, without requiring a Cron Job for every task you want to perform. It requires one Cron Job to run which is pointed at the main handler. SchedMan is useful if you need to deploy a number of repeatable ad-hoc tasks rapidly, or your hosting provider limits the number of Cron Jobs you can run. ===== Version Control ===== SchedMan is currently at V1.0 - Launch Version, this release contains all of the features found in the [[schedman:main#features|Features Section]] - The installer can be downloaded by [[|clicking here]]. ===== Features ===== Please find below an overview of SchedMan's features - see our walkthrough guides for more detail on these: * Simple Installer to get you running quickly * Set up "Jobs" to run scripts at intervals defined by you * Basic Scheduler - Run your job at a defined interval repeatedly * Advanced Scheduler - Define specific time frames and days the job should run, such as Friday between 02:00 and 03:00 * Manage your Jobs through an intuitive GUI * Logging to show how long your schedules are taking to run - your scripts can utilize our logging method for further feedback * Error Handling - see if your jobs have failed on the interface, you can use our method to mark your Job as failed * Optional Alerting if you would like to receive an e-mail if a job fails * Optional password protection for your interface ===== Installation ===== Once you have [[|Downloaded SchedMan]], upload the files to your website hosting platform. Then navigate the folder structure you set up - for example: You will then see the installation page as below: {{:schedman:install1.png?200|}} Continue to fill in all of the fields, they are all mandatory, your screen should look similar to the below: {{:schedman:installentries.png?100|}} When you press the button to install, SchedMan will check you've entered the values for each field, and that your database connection details work correctly. If not you will receive one of the two errors below: - Database details incorrect - could not connect - A field was left empty When you have entered all of the details, and SchedMan can connect to the database you will see the screen below: {{:schedman:install2.png?200|}} **Please ensure you set up the Cron Job, there is help displayed on the screen as to where to point it to, and set it up to run every 1 minute.** Once you have setup the Cron Job, click the Go To SchedMan link, where you will see an empty table. {{:schedman:install3.png?200|}} You should then go to the **Create** screen to add your first schedule. * **SchedRef** - The ID tied to your schedule, for example - UUA1 * **Description** - What does this job do? Describe it for reference * **File** - The file name of the script to run, for example - updateuserattribute.php * **Time To Add** - When the script is run, how many minutes before it should run again? {{:schedman:create.png?200|}} Once you have added the job, you will be taken to the **Modify** screen. {{:schedman:created.png?200|}} Your job will now run, the next time the Cron Job you set-up earlier runs schedman.php ===== SchedMan Screens ===== There are 5 screens available on SchedMan to help you monitor, manage and create your jobs. ==== Basic ==== The Basic screen provides, as the name suggests, a basic view of all schedules with their description and last/next run times. {{:schedman:basic.png?100|}} ---- ==== Advanced ==== The Advanced screen provides more information on your jobs, such as whether the job is currently running or has returned an error. If you have configured the script to do so, it will also show you how many rows your job affected the last time it run. {{:schedman:advanced.png?100|}} ---- ==== Modify ==== The Modify screen lets you change the configuration and details of your jobs. {{:schedman:modifyhighlight.png?100|}} ---- === Advanced Runtime Options === The Advanced Runtime Options screen is accessible through the Modify screen, please see the red box which highlights it in the Modify screen image above. This page allows you to configure an advanced run matrix, where you can specify particular times and days to run the job, for example - Friday betweeen 02:00 and 03:00 The day matrix has seven 1's defined by default, representing days of the week from Monday to Sunday, if you only wanted your job to run on a Friday the matrix would be: 0000100 {{:schedman:advancedmatrix.png?100|}} ---- ==== Create ==== The Create screen allows you to add a new job to SchedMan. {{:schedman:create.png?100|}} ---- ==== Logs ==== The Logs screen shows you the logs generated by SchedMan and your jobs, if you have enabled logging in the installation phase and configured your jobs to do so. SchedMan logging: {{:schedman:logs.png?100|}} SchedMan and job logging: {{:schedman:logswithjob.png?100|}} SchedMan and job logging when Advanced Runtime Options are enabled: {{:schedman:logswithjobmatrix.png?100|}} ===== Schedule Example ===== <file php ScheduleExample.php> <?php //$caller is set to 1 by SchedMan, use this if your scripts should only execute when SchedMan runs them. if($caller) { ///you can use $id to get the SchedRef of your script, useful for logging purposes echo $id; ///$this->date is the datetimestamp last known by SchedMan, you can update this using the method below. Useful for logging. echo $this->date; ///Call this method if you are using $this->date for a DateTime and would like it to be updated - useful for logging purposes $this->UpdateDateTime(); ///generate a log you can see in the database for your script $this->GenerateLog($id, "Script Began Running at: $this->date", -1); ///you can reference $this->db for your database connection if SchedMan is configured on the correct database for this script $this->db->query("SELECT * FROM schedlogs"); ///need to set the job as failed if a try/catch goes wrong or validates incorrectly? $this->setJobAsInError($id, "The job failed as we could not change x to 1"); } </file>

QR Code
QR Code schedman:main (generated for current page)