Sybernet / Supplied Procedures Reference
Release 3.00
Sep 24, 2005
backwards forwards

HTTP.SP_HTML_CRON_REGISTER

The Sybercron Register allows you to schedule the automatic execution of your stored procedures. Your procedures can be executed once or they can be executed every Friday at 8PM. The output of your stored procedure can be e-mailed or written to a unix disk file.

Sybercron is a unix daemon that looks in your database for things to do. For each request found, a new process is spawned that executes that procedure with the attributes you specified. This could be its parameters, content-type, or disposition. Although this analogy never works, you can think of Sybercron as just another user of Sybernet. It is safe to kill any process invoked by Sybercron for the same reason it is safe to kill any process invoked by a user.

The Sybercron register allows you to create and edit aliases (also called groups). To create or edit an alias simply click the label next to the E-mail address, CC, or BCC under Sybernet Parameters. To edit an alias that already exists you can also click the Groups button. When an alias is specifed, Sybercron will either send one invocation of this procedure to that group, or it will invoke this procedure once for each E-mail address when the Recurse option under Subscription Information is specified.

If you send this output to an alias and the Recurse option is unchecked, Sybercron prepends this list with its groupname making it obvious who is in this group. If you want to send this output without having anyone know who else is included in this list, BCC them and use an empty group name in the E-mail address. This can be accomplished with someting like undisclosed recepients:;


Subscription Information:

This section describes general information about your Sybercron job.

Name Description
Title
 
This is the title or subject of your Sybercron job. The Sybercron register will automatically fill this in with its description if it is a Sybernet registered procedure. If it is not registered, it will default to its fully qualified procedure name. This is the name that appears as the title in the Sybercron Monitor, and if the output is being mailed to someone, the subject of this message.
Description
 
This field allows you to enter a description of what this procedure does. Nothing in Sybernet or Sybercron refer to this field so you can use it for anything you wish.
Recurse
 
Run this procedure once for each E-mail address.


Sybernet Parameters:

This section determines how Sybercron is suppose to invoke your stored procedure and what it is suppose do with its results.

Name Description
E-mail address
 
A comma separated list of e-mail addresses. E-mail address or Scriptname are required. Specifying an E-mail address means you want to email the results of this procedure to someone. Specifying a scriptname means you want the results of this stored procedure written to a unix disk file.
From
 
The e-mail address that sent this report. This is required even if this procedure is not creating an e-mail. If you job fails, Sybercron will send an e-mail to this address notifying you that the procedure failed and why it failed.
Scriptname
 
If specified, this is the name of the output file created by your application. Make sure Sybercron has write access to this file if it resides outside of the Sybernet environment.
CC
 
CC this e-mail to this comma separated list of e-mail addresses.
BCC
 
BCC this e-mail to this comma separated list of e-mail addresses.
Priority
 
The priority of this e-mail.
Platform
 
Platform determines which copy of Sybercron is suppose to run this application. For any Sybase server or Oracle instance you may have several copies of Sybercron running from more than one host. When you invoke Sybercron from that host you tell it the platform it is running from. It is that platform that Sybercron looks for in the cron register.
Format
 
Format determines the output format that Sybercron is suppose to be invoked with.
Filter
 
Filter determines how Sybercron is suppose to filter the output results. NULL (the default) means there is no filtering. CGI means the results are sent back the database where those results are the results of this procedure.
Disposition
 
Disposition allows you to specify this application's disposition as inline or as an attachment. In conjunction with Content-Type you can specify that an application opens immediately as an attachment. The default is null which is the same thing as inline. The following example illustrates how to specify an attachment and its filename:
attachment;filename='vehicles.xls'
Content Type
 
This option determines the content-type of these results. Valid values include
  • text/html (default)
  • text/plain
  • application/html
  • other...

application/html is a convenient way to force your HTML output as an attachment. Other allows you to specify your own content-type. Any content-type that is not text/html or text/plain is sent as an attachment.



Procedure Parameters:

This section will list each parameter name to your stored procedure where you can specify what that parameter is suppose to be. If you leave this field blank, Sybercron does not pass NULL to this procedure. Instead, it does not even pass this parameter to your procedure. This is what you would expect if your stored procedure allows NULL or a default value on its own.

All Sybase parameter names are passed as varchars. In Oracle, Sybercron determines its attribute type and will pass varchars as varchars, numbers as numbers, and Booleans as Booleans.

You can control how these parameter names are displayed using the table CRON_KEYWORDS. For example, if you always use DEBUG as a Boolean value, you can arm this as a drop-down list of TRUE or FALSE. For more information, have a look at this table and I'm sure you'll figure out how it works.

Name Description
Name
 
The value of this parameter.


Timestamps that affect this procedure:

This section determine when your stored procedure is allowed to run. You can specify a start date that tells Sybercron not to run this before this date, or you can specify a stop date that tells Sybercron not to run this after this date.

Name Description
Timestamp
 
This value determines the next time this procedure should be executed. If you do not specify a value for timestamp, Sybercron will determine this automatically.
Start Time
 
If not NULL, this field determines the earliest time this procedure can be executed. Normally this is NULL, but if you wanted to schedule a reoccurring job to run in the future, you would use this field to arm the earliest date this procedure can be executed.
Stop Date
 
If not NULL, this field determines the last time this procedure can be executed.


The following specifies when this job is executed:

For reoccurring entries--jobs that are suppose to run periodically--this section determines that period. You may, for example, want to run the same procedure each Friday at 8PM, or you may want to run this procedure once only next Friday at 8PM. The default is once only which means this procedure is run only once and discarded from the cron table.

Name Description
Datename
 
DATENAME determines when your procedure is actually executed. DATENAME is one of the following values:

  • ONCEONLY (once only, then discarded)
  • HOUR (every hour)
  • DAY (every day)
  • WEEKDAY> (Monday through Friday)
  • SUNDAY (every Sunday)
  • MONDAY (every Monday)
  • TUESDAY (every Tuesday)
  • WEDNESDAY (every Wedneesday)
  • THURSDAY (every Thursday)
  • FRIDAY (every Friday)
  • SATURDAY (every Saturday)
  • MONTH (every month, executed on DAY)
  • JANUARY (every January)
  • FEBRUARY (every February)
  • MARCH (every March)
  • APRIL (every April)
  • MAY (every May)
  • JUNE (every June)
  • JULY (every July)
  • AUGUST (every August)
  • SEPTEMBER (every September)
  • OCTOBER (every October)
  • NOVEMBER (every November)
  • DECEMBER (every December)

Day
 
DAY corresponds to the day of the month. This value is meaningful only when DATENAME is MONTH or corresponds to one of the months of they year.
Hour
 
HOUR represents the hour of the day.
Minute
 
MINUTE represents the minute of the day.


The following specifies what to do when completed:

This section determines what to do when your procedure has completed. You have the ability to rerun it in case it failed or execute another procedure when it succeeded.

Name Description
Suspect
 
If your procedure or script did not complete successfully, this option allows you to restart it once or restart it forever until it does complete successfully.
Success
 
This option allows you to execute another procedure when this procedure completes successfully. That procedure must be registered with the Sybercron Register. You would usually specify a Stop Time sometime in the past so that that procedure wouldn't be scheduled except through this facility.



See Also

SP_CRON_INSERT
SP_CRON_INSERT_PARAMETER
SP_HTML_CRON
SP_HTML_CRON_MONITOR
SYBERCRON




Sybernet is a trademark of SRI International.
Copyright © 1996-2009 SRI International. All Rights Reserved.
Denis D. Workman / http://Sybernet.sri.com/