T_062111430001
Cron the Clock Daemon

For Windows

Overview

Installation

Events

Event List

Setup

Message Log

Cron Schedule Files

Licensing and Authorization Codes

Purchasing a License

Potential Problems

Copyright Information

Copyright 1994-1995, Software Engineering, Inc.

All rights reserved.


Overview

Until now, there has been no good way to schedule regular system events in Windows.  In the Windows world, applications that require scheduling are expected to provide this functionality themselves.  This requires each of these applications to run constantly in order to notice when their scheduled event must take place.  The average user probably does not want to keep a backup program running constantly so that it can make a system backup only once a week or once a month.  This lack of scheduling capability also makes it impossible to schedule an MS-DOS batch file or program for future execution.

The Cron program, also referred to as the Clock Daemon, was created by Software Engineering, Inc. to bring this kind of functionality to Windows.  Cron was modelled after the Unix daemon of the same name.  This version, however, brings the friendliness of the Windows interface to this otherwise cryptic Unix utility.

Cron uses a powerful scheduling system to execute events at specified dates and times.  Any reasonable number of regularly scheduled events can be specified.  Events can include a combination of a command to execute, a WAV file to play, and/or a text message to display.

Cron is SHAREWARE.  It is NOT free or "public domain" software.  You are granted a 90 day trial period in which to evaluate the program.  By the end of this period you should have decided whether Cron suits your needs or not.  If not, simply stop using it.  If, on the other hand, you choose to continue using Cron, you must purchase a software license from Software Engineering, Inc.


Installation

The Cron program, given the nature of what it does, should be set up to run whenever Windows is running.  This is usually accomplished by creating an Item entry in the StartUp group of the Program Manager.

Cron is easy to install, requiring no particular path or directory structure.  The following steps describe how to install the program.

1. Using the File Manager, copy the CRON.EXE file to a directory on your hard drive.  It does not have to be in your path.

2. Locate the CRON.EXE file on your hard drive using the File Manager.

3. Using the mouse, select and drag the CRON.EXE file from the file list in the File Manager and drop it in the StartUp group in the Program Manager.  Cron is now set up to run automatically whenever Windows is run.

4. Select the new Cron icon in the StartUp group of the Program Manager.

5. On the menu bar of the Program Manager, select File|Properties or press Alt-Enter.  This will bring up the Program Item Properties dialog for the Cron icon.

6. Turn on the checkbox labeled "Run Minimized" and then select OK.  Now Cron will run as an icon.

7.  To get Cron going right now, double click on the Cron icon in the StartUp group of the Program Manager.


Events

A Cron event is some task that must be executed at a future date and time.  This can include one-time events as well as events that must be repeated at regular intervals.  Examples include reminder messages, nightly software compiles/builds, hourly chimes, system backups, or even a tolling bell at midnight.

Events consist of a command to execute, a WAV file to play, and/or a text message to display.  Any combination of these three components can be used in a single event.

Events are added by selecting the Event|Add option on the Clock Daemon menu bar.  This will bring up the Add Event dialog.  This dialog consists of three sections, Description, Event, and Schedule.

Description

You must provide a description of each event.  This description will show up on the event list, discussed later.

Event

This section identifies the components of the event.  You must fill in at least one of the edit boxes in this section, labelled Command, WAV File, and Message.

•	Command - Specifies a command to execute.  This may contain command line options as well.  A Browse button is available for your convenience.

The command control is accompanied by a set of radio buttons for selecting the execution mode:

•	Execute Normally - The command is executed normally.

•	Run Minimized - The command is executed as an icon, if possible.

•	Exit Windows to Run - Windows will shut-down, the command is executed, and then Windows is restarted. This execution method can fail if any application in the system does not terminate.

Windows NT exhibits slightly different behaviour when this option is selected. The current user session is closed and the command is executed when the next user logs in.

•	WAV File - Specifies a WAV file to play.  In order to play a WAV file, you must have a multi-media sound driver capable of playing WAV files installed in Windows.  A Browse button is available for your convenience.

•	Message - Specifies a text message associated with this event.  When the event goes off, this message will be added to the cron log and the log messages will be displayed.  The cron log and log messages menu are discussed later.

Schedule

This section specifies the time and date schedule for this event.  There are four edit boxes, labeled Hour, Minute, Month and Day, and a set of seven check boxes for the Day of Week.  Any combination of legal values can be used, offering a highly flexible and powerful scheduling system.  An additional check box labeled Disable Event can be selected to disable an event without removing it from the event list.

Values in the edit boxes can be expressed a number of ways.  An asterisk '*' is a wild card which indicates all possible values for a given field.  Multiple numeric values can be listed, separated by a comma; i.e. 3,6,9,12.  An inclusive range of values can be specified using a dash '-'; i.e. 15-30,45-59.  This syntax can of course be combined; i.e. 5,10,12-15,18-20,23.

Each edit control has a range of legal values.  Hour is 0 through 23, using a 24 hour clock to distinguish between AM and PM.  Minute is 0 through 59.  Month is 1 through 12.  The Day range is 1 through 31.

Event Examples

Here are some event examples.

Description: A meeting reminder on wednesdays at 7:30am.

WAV File: c:\windows\chime.wav

Message: Weekly status meeting.

Hour: 7

Minute: 30

Month: *

Day: *

Day of Week: Only Wednesday checked

Description: A nightly backup (during the week).

Command: c:\bat\mybackup.bat

Hour: 18

Minute: 15

Month: *

Day: *

Day of Week: Monday through Friday checked

Description: A tolling bell at midnight.

WAV File: c:\wav\belltoll.wav

Hour: 0

Minute: 0

Month: *

Day: *

Day of Week: All days checked


Event List

The event list is displayed in the Clock Daemon window.  This is a list of the events in the Cron schedule.  Information is displayed in two columns, labeled Type and Description.  In the Type column, each event will show a combination of EXE, WAV, and MSG, depending on which components make up the event.  The Description column will contain the text supplied in the Description box when the event was added or last modified.  Items are not listed in any particular order. An event that is disabled will be listed with a red line through it.

When an event is selected in the event list, it can then be deleted or modified using options on the Event menu on the Clock Daemon menu bar.  Double clicking on an item in the event list will bring up the Modify Event dialog, allowing you to inspect and modify the event.

Some keys on the keyboard can be used to manipulate the event list as well. The Insert key will add a new event. The Delete key will delete the selected event. The Enter key will modify the selected event.


Setup

The Clock Daemon has a few setup options which can be configured on the Cron Setup dialog. This dialog is displayed by selecting the File|Setup menu command.

•	Log All Events - This check box enables logging of all Cron events. When checked, a message will be added to the message log whenever a Cron event goes off, regardless of whether it included a text message.  Only events which include a text message will cause the Cron Event Messages dialog to appear, even if this option is enabled; other events are recorded quietly.

Window

These options apply when the Clock Daemon is running as a window.

•	Date - When checked, the current date will be displayed on the title bar.

•	Time - When checked, the current time will be displayed on the title bar.

Icon

These options apply when the Clock Daemon is running as an icon.

•	Date - When checked, the current date will be displayed under the icon.

•	Time - When checked, the icon will show the current time.


Message Log

The message log is a text file maintained in the Windows directory.  The file name is CRONLOG.TXT.  When Cron events go off that include a text message, that message is appended to this file and the Cron Event Messages dialog is displayed so you can read the event text.  The Cron Setup dialog option Log All Events, when checked, will result in a message being appended to this file whenever a Cron event goes off, regardless of whether it included a text message.  Only events which include a text message will cause the Cron Event Messages dialog to appear, even if Log All Events is enabled; other events are recorded quietly.

Cron does not care about the format of this file.  The only restriction is that each line should not exceed about 256 characters.  In general, each line is thought of as a discrete entry.  Feel free to have other tasks add status information to this file.  An example might be to have a scheduled backup append a time stamped "Completed" message to this file when it's done.  Items added in this way will not cause the Cron Event Messages dialog to display.  If the dialog is already visible, new messages will appear within a few seconds of their addition to the log file.

The Cron Event Messages dialog shows the contents of the Cron log.  It is automatically displayed when an event goes off that contains a text message.  You can bring up this dialog manually by selecting the Event|Messages command from the menu bar.  When this dialog is visible, all new logged event messages will appear at the end of this list and scroll into view.

When viewing the Cron event log, you may select one or more list items and remove them from the Cron log by pressing the Delete Selected Messages button. You can erase the entire Cron log by pressing the Clear Log button. This simply deletes the CRONLOG.TXT file. It will automatically be recreated when needed by Cron.


Cron Schedule Files

Cron maintains its working schedule in a file in the Windows directory.  The name of this file is CRON.TAB.  It is automatically updated as events are added, modified, and deleted from the schedule.  The user is never required to load or save the current Cron schedule.

The File menu has options for saving and loading Cron schedules.  Cron schedule files have the .CRN file extension.  If you wish to save your current Cron schedule in a file, use the File|Save As menu command.  To erase your current Cron schedule, select File|New.  To replace your current Cron schedule with a new one, use the File|Open command.  The File|Append command allows you to add a saved Cron schedule to the current schedule.


Licensing and Authorization Codes

Cron is distributed under the SHAREWARE concept.  This is NOT free or "public domain" software. Upon installation of Cron, you are allowed to use it free of charge for 90 days in order to try out the program. After evaluating the software, you are expected to decide whether to continue using it or not.  If you choose to continue using the software, you must purchase a license. If you find that Cron does not meet your needs or perform to your expectations, simply remove it from your system. Unlike real daemons, this one's easy to banish.

Until you purchase a software license, the Cron Authorization dialog will appear every time you execute Cron. This serves as a reminder that you are only evaluating the software and have not yet purchased a license. When you purchase a license, you will be issued a software license number and authorization code. These are entered into the Cron Authorization dialog, available by selecting File|Authorize Cron from the Cron menu bar. Once entered, Cron will run quietly and unobtrusively. You should save your license number and authorization code in a safe place in case you should have to reload your system in the future.

Also, your license number and authorization codes will work on future versions of Cron. When a new version becomes available, you only need to get a copy of the upgraded software.


Purchasing a License

A license to use Cron on your system can be purchased directly from Software Engineering, Inc. The cost of a license is an extremely reasonable $24.95. Please send a check or money order; it is never wise to mail cash.  No COD orders, please.

Software Engineering, Inc.

8352 S. Sunnyside Place

Highlands Ranch, Colorado 80126

303-470-7142

Internet: daveh@freehome.com

When placing an order, please provide as much of the following information as possible.

•	Company name

•	Your name

•	Complete mailing address

•	Internet e-mail address

•	Telephone number

•	FAX telephone number

We will respond promptly. You will receive your license number and authorization code by e-mail or fax, if possible. Otherwise, your authorization information will be sent by mail.


Potential Problems

•	Some users have reported that the Clock Daemon prevents their Windows screen saver from activating while it is running as an icon. I have not been able to reproduce this behaviour under Windows NT Workstation, Windows 95, or Windows for Workgroups. If you experience this problem, try disabling the time display on the icon.

•	 The command execution option "Exit Windows to Run" behaves strangely when running under Windows NT. Cron uses the Windows API function ExitWindowsExec() to execute such commands. Under Windows NT, the current user is logged off. The command gets executed when the next user logs in, whether or not it was the user that submitted the command.

·

•	The command execution option "Exit Windows to Run" will fail if any running process refuses to die. This can happen if a running application has unsaved data that it thinks the user should be involved in saving.

·

•	The command execution option "Exit Windows to Run" does not seem to work with Windows for Workgroups 3.11. Cron uses the Windows API function ExitWindowsExec() to execute such commands. This function is documented in the Windows API and supported by my compiler. Unfortunately, both WfWG machines on which I have tested it simply rebooted. I have meticulously read and reread the documentation on this function. I have also carefully insured that the parameters I am passing are valid. Nevertheless, it doesn't seem to work. I will continue to investigate this problem. If anyone can provide me with some insight into this function, please send me e-mail. I'd be glad to give you a free authorization code for Cron in exchange for the information.

·

•	When running a DOS .BAT file, the settings in _DEFAULT.PIF are used. If the "Close Window on Exit" option is not checked, the inactive DOS window will remain after the task has finished. You can remedy this by changing the setting in _DEFAULT.PIF or by making a .PIF file for the .BAT file you are going to execute.


Copyright Information

Cron the Clock Daemon

Copyright 1994-1995, Software Engineering, Inc. All Rights Reserved.

Software Engineering, Inc. disclaims all warranties as to this software, whether express or implied, including without limitation any implied warranties of merchantability, fitness for a particular purpose, functionality, data integrity or protection.

Software Engineering, Inc. maintains a high standard of quality in its products. If you experience a problem that is related to our software, we will make a reasonable effort to solve it.