ReadMe for CronTool v0.08 (2nd Nov 2007)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Purpose:
~~~~~~~~
	To provide execution of commands at automated timed intervals.
	CronTool is Shareware. If you find it useful, please register it.

	Unregistered versions are limited to 15 minutes of use in one go.

	Please see HTML manual for more comprehensive notes, as this file
	was written rather hastily. :-)
	

Commands:
~~~~~~~~~
	.xxx		Define label xxx (see 'goto' below)
	
	after xx yy	After xx seconds do command yy
			(like every but only occurs once)
			
	alarm on	Sound alarm
	
	alarm off	Stop alarm
	
	beep		Sound a system beep
	
	cli xxx yy zz	Pass xxx yy zz onto the RISC OS CLI interface.
	
	email xx yy	Email user xx message template yy
	
	every 60 xxx	Every 60 seconds do command xxx
	
	ftp user pass host directory
			Invokes FTPc plugin to upload everything in directory
			'directory' to remote host using username and
			password.
	
	goto xxx	Jump to label xxx where the label is defined as
	                above.
	
	if		Test for condition (see below)
	
	kill every	Delete all 'every' repeating processes (see above)
	
	loadapp	xx	Load application xx (where xx is the full filepath)
			Also accepts 'appload' command.
	
	log xx		Write "xx" to log file (if logging enabled)
	
	mkdir xxx	Make a new directory xxx where xxx is full pathname
	                of directory required.
	                (command cdir also works)

	ping host	By itself this command just sets the internal
	                'packetloss' variable. However, used in conjunction
	                with set pingalarm and set pingwarning can alert you
	                to non responding servers.
	                
	prequitapp xx	Issue a wimp 'pre-quit' message to application xx
	                (xx = task name as per task display).
	                Also accepts 'prekillapp' command.
	                
	quitapp xx	Quit application xx (xx = task name as per task 
	                display.
	                Also accepts 'killapp' command.
	                
	reset		Reset and reboot the computer. Use with care!
	
	respawn xx yy	Setup a background watcher so that if application xx
	                is not loaded it will start task yy
	                xx = task name (as shown in task display)
	                yy = full filepath to application to load.

	rmdir xxx	Wipe directory xxx AND it's entire contents, where
			xxx is full pathname of directory to wipe.
	                NB. Very dangerous, so make sure you've got the 
	                correct filename!!
	                
	set alarmtime xx 	Set the alarm time to xx seconds (min 5 secs)
	                so that when the alarm sounds, its duration will be
	                xx seconds. Default value=60
	                
	set mta xx	Set mail transport agent (MTA) to xx

			xx = popstar (only currently supported one so far!)
			xx = posty
			xx = ant

			will generate warning message if can't locate.
			(see below for set email header commands)
			
	set pingalarm	Sound alarm if future pings fail.
	
	set pingwarning	Enables pingwarning, which will display a warning
			message on screen if future pings fail.
			
	shutdown	Force a shutdown of the machine. Use with care!
	
	unset pingwarning	Disable pingwarning, so future ping failures
			will not display a warning message on screen.
	
	unspawn xxx	Remove application xxx from the respawn (see above)
	                list so that it will no longer respawn if quit.
	
	url xx		Launch URL xx

	wait xx		Wait for xx seconds doing nothing.
			(where 0 < x <= 60)
			
	warning message	Open a warning window displaying message.
			
	wipelog		Wipe the CronTool log file.
	
	zip create xxx	Create a zip archive with filename xxx.
	
	zip add xxx	Add file/directory xxx to zip archive opened with
	                zipcreate command.


IF Commands:
~~~~~~~~~~~~
	if day=5 xxx		If day of week is Thursday (5) then execute
	                        command xxx.
	
        if not day=1 xxx	If day of week is not Sunday (1) then 
                                execute command xxx.
                                
        if tue xxx		If day is Tuesday then execute command xxx.
        
        if apr xxx		If month is April then execute command xxx.

	if date=0205 xxx        If the date is 2nd May then execute command
	                        xxx.
	                        
	if year=2006 xxx	If the year is 2006 then execute command xxx.
	
        if app=loaded xxx	If application "app" is loaded then execute
                                command xxx.
                                
        if app=notloaded xxx	If application "app" is not loaded then
                                execute command xxx.
                                
        if ping host xxx	Ping host and if successful do command xxx
				(not implemented yet)
				        
                                
Set Commands:
~~~~~~~~~~~~~
	set from xxx		Set from address to xxx where xxx is a valid
	                        email address.
	                        
	set name xxx [yyy]	Set real name to xxx yyy where yyy is
	                        optional.
	                        
	set reply-to xxx	Set reply to xxx where xxx is a valid email
	                        address.
	                        
	set subject xxx		Set subject to xxx


Limitations:
~~~~~~~~~~~~
If you do anything network related (ie. ping, FTP etc) when there is no
network connection (ie. lead disconnected), the machine will hang for
sometime until the network connection times out. I can't seem to find a way
of bypassing this. Non-responding pings etc are detected in a couple of
seconds, but there doesn't appear to be a way of checking a network
connection.

CronTool will only run continuously for approx 31 years, due to incrementing
the number of seconds since loading in an integer variable. Therefore the
maximum length of time CronTool can run for is approx 1E9 seconds.

Maximum of 30 parameters per line.
Maximum of 20 'every' events.
Maximum of 20 'after' events.
Maximum of 20 'respawn' applications.


To Do:
~~~~~~
Add items not implemented yet.
Any further suggestions?


Author:
~~~~~~~
CronTool is the copyright of Paul Vigay.

Email: nospam@vigay.com
  Web: http://www.vigay.com/software/


Version History:
~~~~~~~~~~~~~~~~
 v0.08 (2nd Nov 2007)
        a) Bug fix: Amended quit code so that applications quit cleanly without leaving files
           open.
        b) Added "prequitapp" command, to send a wimp 'pre-quit' message to specific
           applications.
        c) Added new misc timer function - run bath, with a 9 minute delay.
        d) Bug fix: Corrected format of auto-email generation for the Ant Suite.
        
 v0.07 (13th Sep 2006)
        a) Amended logging to use SysLog if available, otherwise falling back to Wimp$Scrap.
        b) Edited !Run file slightly to improve ABCLib detection.
	
 v0.06 (26th Jun 2006)
        a) Fixed a few spelling mistakes in this manual.
        b) Amended 'every' and 'after' code so that simultaneous events don't clash with each
	   other.
        c) Improved logging of FTP events.
        d) Added support for ---- to represent immediate events (as well as -1-1)
        e) Added Tools-&gt;Log-&gt;Show to menu, to open logfile.
        f) Added new Tools-&gt;Show sub-menu.
        g) Added <a href="#faq">FAQ</a> section to manual.
        h) Added 'Memo' facility.
        i) Added 'Tea' easter egg. ;-)
        j) Adjusted wimp_poll timing slightly.
        k) Added 'screensave' and 'nextslot' commands.
 
 v0.05 (23rd Jun 2006)
	First version - should be all working ok.

2006-7 Paul Vigay
