Cron Design: Introduction: Difference between revisions

Proofreading and grammatical changes
(New page: {{Nav Cron Design}} Portable Cron was integrated into Uniform Server 5-Nano although useful suffered from a number of limitations. A new design has addressed these issues and offers more f...)
 
(Proofreading and grammatical changes)
 
Line 1: Line 1:
{{Nav Cron Design}}
{{Nav Cron Design}}
Portable Cron was integrated into Uniform Server 5-Nano although useful suffered from a number of limitations. A new design has addressed these issues and offers more flexibility.
Portable Cron was integrated into Uniform Server 5-Nano. Although useful, it suffered from a number of limitations. A new design has addressed these issues and offers more flexibility.


That said you may find it does not meet your particular requirements solution is to design new scripts or modify the existing ones.
That said, you may find it does not meet your particular requirements.  The best solution is to design new scripts or modify the existing ones.


The following provides a detailed description of the current implementation, which you can use as a basis for new designs or tweak the exiting scripts.       
The following provides a detailed description of the current implementation, which you can use as a basis for new designs or tweak the existing scripts.       


== Background ==
== Background ==
Before looking at configuration the following provides a quick overview what portable Cron is and what it is not.
Before looking at configuration, this is quick overview what portable Cron is and what it is not.


=== Cron ===
=== Cron ===
Cron originated from a Unix environment it is a job scheduler allowing scripts to be run automatically at a certain time or date.
Cron originated from a Unix environment. It is a job scheduler that allows scripts to be run automatically at a certain time or date.


Cron (chronograph) has become a more general term referring to a periodic tick.
Cron (chronograph) has become a more general term referring to a periodic tick.


'''''[[#top | Top]]'''''
=== Portable Cron ===
=== Portable Cron ===
Why portable Cron? A permanent installation of UniServer running as a service you can set-up Windows to schedule a task similar to Unix Cron check out [http://support.microsoft.com/kb/308569 How To Schedule Tasks in Windows XP] for details?
Why portable Cron? For a permanent installation of UniServer running as a service, you can set up Windows to schedule a task similar to Unix Cron. Check out [http://support.microsoft.com/kb/308569 How To Schedule Tasks in Windows XP] for details


This is not practical when running UniServer from a USB memory stick which implies portability you need to reconfigure each new machine. UniServer 5.0-Nano resolves this with a small script scheduler referred to as portable Cron.
This is not practical when running UniServer from a USB memory stick, which implies portability. It means you need to reconfigure each new machine. UniServer 5-Nano resolves this with a small script scheduler referred to as portable Cron.


It’s fully integrated into UniServers’s control architecture allowing it to be run from either batch files or UniTray.
It’s fully integrated into UniServers’s control architecture, allowing it to be run from either batch files or UniTray.


'''''[[#top | Top]]'''''
== Configuration ==
== Configuration ==
To understand the design it’s worth first looking at configuration. Knowing how to configure Cron also serves as a specification.
To understand the design, it’s worth first looking at configuration. Knowing how to configure Cron also serves as a specification.


To run each individual script a number of parameters are set in a configuration file '''cron.ini''' This file has a standard format making it very easy to use and set up  
To run each individual script, a number of parameters are set in a configuration file: '''cron.ini'''. This file has a standard format making it very easy to set up and use.


Each script to be run is defined in a self-contained block. Each block starts with a unique header see following example:
Each script to be run is defined in a self-contained block. Each block starts with a unique header. Here's an example:
<pre>
<pre>
[moodle]  
[moodle]  
Line 36: Line 34:
ref =
ref =
</pre>
</pre>
'''''[[#top | Top]]'''''
 
=== Explanation ===
=== Explanation ===
{|
{|
Line 50: Line 48:
|'''ref''' ||- A tracker set by Cron script effectively time to next run. Deleting this value allows a new start time to be set (covered later)
|'''ref''' ||- A tracker set by Cron script effectively time to next run. Deleting this value allows a new start time to be set (covered later)
|}
|}
'''''[[#top | Top]]'''''
 
=== Detail ===
=== Detail ===
{|
{|
Line 95: Line 93:


'''''Note 1'':''' Cron automatically updates ref with the initial start time set and<br />
'''''Note 1'':''' Cron automatically updates ref with the initial start time set and<br />
period. Every time a script is run the value is updated with a new Cron reference<br />
period. Every time a script is run, the value is updated with a new Cron reference.<br />
this defines when the next run is to start.               
This defines when the next run is to start.               


'''''Note 2'':''' To specify a new start time first set a new value for start and<br />
'''''Note 2'':''' To specify a new start time first set a new value for start and<br />
delete the ref number (if there is one), save the file. The script will run at the<br />
delete the ref number (if there is one), then save the file. The script will run at the<br />
date and time set and thereafter at a period you defined
date and time set and thereafter at a period you defined.
|}
|}
'''''[[#top | Top]]'''''
 
== General notes ==
== General notes ==
Configuration file location: UniServer\unicon\main\'''cron.ini'''  
Configuration file location: UniServer\unicon\main\'''cron.ini'''  
Line 122: Line 120:
* <nowiki>http:</nowiki>//localhost:81/drupal/cron.php
* <nowiki>http:</nowiki>//localhost:81/drupal/cron.php


'''''[[#top | Top]]'''''


== How to run portable Cron ==
== How to run portable Cron ==
Line 138: Line 135:
* To stop Cron: Double click on Stop_Cron.bat
* To stop Cron: Double click on Stop_Cron.bat


'''''[[#top | Top]]'''''


=== Automatic ===
=== Automatic ===
Line 158: Line 154:
  "%PHP%\php.exe"; Parameters: " -n %ServerConMain%\stop_servers.php 7";ShowCmd: hidden; Glyph: 11
  "%PHP%\php.exe"; Parameters: " -n %ServerConMain%\stop_servers.php 7";ShowCmd: hidden; Glyph: 11
</pre>
</pre>
'''''[[#top | Top]]'''''
 


== Logging ==
== Logging ==