Statements>Schedule
Introduction Installation Beginning Admin Quick Ref FTP Server SMTP Server Database Security
Statements Objects String Parsing Events Queues Samples Special names Error Handling Accessories   Back
Caravan Business Server>Help>Statements>Schedule
Syntax
<CARAVAN>
      Schedule = (<timespec>=<value>,...,<value>&......&<timespec>=<value>,..,<value>[&count=nnn])
</CARAVAN>
Text
        Caravan Schedule object when specified in the code page (normally under templates folder) makes the page automatically  execute at specified intervals. You can define multiple code files as schedulers, each doing a specified task at different interval.
        
timespec       :      times  specifications / time table in hour, minute, second, year, day, month, date.
n1...n24       :      are valid numbers for the respective timespec.
hour             :      1 to 24
minute             :       0 to 59
month             :       jan to dec or 1 to 12. Only first three letters required. Feb and February are valid.
day             :       sun to sat or 1 to 7. Only first three letters required.  Sun and Sunday are valid.  
date             :        1 to 31
year             :        greater than 0. 2000 is current and values added should be less than 100.
count             :       can be any integer value and is optional


Rules:
* Caravan Schedule syntax should be placed at the top of the code page.
* To prevent unauthorised access to these files, <caravan>domain admin</caravan> must be placed at the top of the file. The code file containing the schedule syntax can also be executed manually from the browser.
* At least one timespec should be specified in the schedule statement.
* If count is specified, scheduled web page is executed only the specified number of times.
* Schedule statement can be put anywhere in the web page. Only the first occurrence is valid, rest of the Schedule statements are ignored.
* The web pages should be in the templates path.
* The domain at run time is always admin for web pages containing schedule statements.
* Persistent objects are not accessible at schedule time.
* The output of the scheduled process is directed to tmp\\schedule.log
* If you add a new schedule page, you must restart Caravan Business Server for the scheduling to become active.
* Timespecs hierarchy is as follows: Year, Month, Date, Day, Hour and Minute. When a timespec is not specified, it is assumed to be valid for all values or for the lowest value, depending on whether the unspecified timespec is higher or lower in hierarchy compared to the specified values.
* If only date is specified, then all values of year, month, day are valid and minute and hour is assumed to be 0.
* Periodic scheduling is achieved by putting mulitple values. Maximum is 24

Sample

<HTML>
<BODY>
<CARAVAN>
    schedule = (day=mon) // every monday once
      schedule = (minute=all) // every minute
      schedule = (minute=all&count=1) // only once a minute after startup
      schedule = (hour=1) // every day once
      Schedule =(minute=0,15,30,45); //four times every hour
      Schedule =(hour=10) ; //ten o clock every day
      Schedule =(date=1&month=1); //on 1st jan at  0000 hrs every year
      Schedule=(minute=1); //schedule the  task to run every hour

</CARAVAN>
</BODY>
</HTML>
Quick Reference
Home       Back