Home
Products
News
Help Center
Download
About BadBlue


BadBlue Scheduling - Frequently Asked Questions
BadBlue Help Center     BadBlue Discussion     Email support
 

What is BadBlue Scheduling?

BadBlue integrates a complete, powerful scheduler that can capture web pages, run PHP scripts and execute Windows commands on a daily, weekly, monthly or yearly basis. Scheduling is controlled through the EXT.INI configuration file and is extremely easy to use.

For users familiar with the UNIX cron utility, BadBlue's scheduler works similarly. It should be easier to use and maintain and is designed for web operations with its ability to capture web pages and execute web scripts (in addition to its ability to execute conventional Windows applications and commands).


 

How many jobs can I schedule?

BadBlue Personal Edition allows scheduling of a single job. The Enterprise Edition allows scheduling of up to 100 jobs.


What is schedule logging?

BadBlue will log its scheduling acitivities to a file named SCHED.LOG in the directory to which BadBlue was installed. You can review the schedule log file to ensure that jobs were triggered correctly.


Can I see a simple example?

Absolutely. Before we get started, make sure that scheduling (an optional feature) is enabled. Use Notepad and add the following line to the EXT.INI file (which is located in the folder to which BadBlue was originally installed, e.g., c:\program files\badblue\pe). You'll only need to do this once: this will tell BadBlue that you want to use the scheduling feature.

  [FLDS]
  scheduling=Yes

If a [FLDS] section already exists in the EXT.INI file, just add the scheduling=Yes line directly underneath the [FLDS] line.

Now, let's schedule a job:

  [SCHED]
  job1=at=19:28 recurs=daily event="http://127.0.0.1 >c:\sched1.txt"

Schedule the job for five minutes in the future (local military time). For example, if it's now 7:23 pm, schedule the job for 19:28 (or 7:28 pm). Make sure that a port number is added to the URL (e.g., 127.0.0.1:8080 if you're running BadBlue on a port other than 80. Exit BadBlue and restart using the Windows Start button and then selecting BadBlue. At 7:28PM, check for the sched1.txt file in the C:\ folder (or wherever you placed it). The retrieved page should be contained in the file.


What are the fields I can use in JOB statements?

Required fields are:

  at="[YYYY-MM-DD] <HH:MM>[:SS]"
  event="<event>"

- The 'at' field specifies when the event is to occur. It can take the form "HH:MM" or "HH:MM:SS" (for daily events) or "YYYY-MM-DD HH:MM:SS" for other events. For example, a valid 'at' field would be at="2002-02-14 18:30:00".

- The event field can represent either a URL that is to be captured or a Windows command that is to be executed (see below for examples).

Optional fields are:

  recurs=<daily|weekly|monthly|yearly>
  interval=<1-n>
  instance=<-1,0,1,2,3,4>
  dayofweek=<MTWRFAS>
  dayofmonth=<1-31>
  occurrences=<1-n>
  recurstartdate="<date> <time>"
  recurenddate="<date> <time>"

Recurs describes whether the event is recurring and its frequency (daily, weekly, monthly or yearly).

Interval specifies a recurring interval (e.g., for an event that is to occur every two weeks, specify recurs=weekly and interval=2).

Instance specifies the week for a monthly or yearly event (e.g., for an event that occurs the third Wednesday of every month, specify recurs=monthly, instance=3 and dayofweek=W). For the last week of each month, specify an instance of -1.

Dayofweek specifies the day(s) of the week for the event (e.g., an event that is to occur every weekday, specify recurs=daily and dayofweek=MTWRF. The letters MTWRFAS stand for Monday, Tuesday, Wednesday, Thursday, Friday, Saturday and Sunday respectively.

Dayofmonth specifies the day that a monthly event is to take place (e.g., for an event that is to occur on the 1st of every month, specify recurs=monthly and dayofmonth=1.

Occurrences specifies the number of times an event is allowed to recur (e.g., for an event that is to occur exactly eight weeks in succession, specify recurs=weekly and occurrences=8).

Recurstartdate specifies the start of a recurring event. If not specified, the event is considered to recur 'forever' (or until the occurrences count expires or the recurrence end date is reached). The date takes the form "YYYY-MM-DD HH:MM" (e.g., recurstartdate="2002-03-01 12:00").

Recurenddate specifies the end of a recurring event. If not specified, the event is considered to recur 'forever' (or until the occurrences count expires). The date takes the form "YYYY-MM-DD HH:MM" (e.g., recurenddate="2002-09-01 14:00").


How about some more examples?

Sure. When adding jobs into the EXT.INI file, make sure that the lines do not wrap (each job must be on a distinct line).

  [SCHED]
  job1=at="2002-01-01 01:00:00" recurs=weekly interval=2 event="http://www.phpbuilder.com >>c:\temp\phpbuilder.txt"
  job2=at="2002-01-01 12:00:00" recurs=daily event="run c:\windows\command.com /c dir c:\temp >c:\temp\directory.txt"

JOB1 reads the front page of PHP Builder every two weeks at 1:00AM and concatenates the page into the file c:\temp\phpbuilder.txt.

JOB2 runs each day at noon and saves the state of the c:\temp folder into the file c:\temp\directory.txt.


What are valid events?

Events take two basic forms: (a) a retrieval of a URL - in which the event string begins with http:// and (b) execution of a Windows program - in which the event string begins with the keyword run. Sample event strings include:

1)  event="run c:\utils\sysbackup.exe"
2)  event="run c:\windows\command.com /c dir c:\temp >c:\temp\directory.txt"
3)  event="run c:\winnt\system32\cmd.exe /c dir c:\temp >>c:\temp\directory.txt"
4)  event="http://127.0.0.1:9000 >>c:\temp\homepage.txt"
5)  event="http://www.newslinx.com >c:\temp\newslinx.txt"

- Example 1 demonstrates execution of a standard Win32 application.

- Example 2 demonstrates execution of a Win9X (e.g., Windows 95, 98, ME) command-line interpreter (e.g., to run a batch file or DOS-style command). Standard-output of the command is redirected to a text file.

- Example 3 demonstrates execution of a Windows NT (e.g., Windows NT, 2000) command-line interpreter (e.g., to run a batch file or DOS-style command). Standard-output of the command is concatenated to an existing text file (note that > indicates that the file is overwritten each time the command executes; >> indicates that the output is concatenated to the end of an existing file if one exists).

- Example 4 demonstrates capture of a local (BadBlue-driven) web page. Standard-output of the command is concatenated to an existing text file.

- Example 5 demonstrates capture of a remote web page. Standard-output of the command is redirected to a newly created text file.


 
BadBlue Help Center     BadBlue Discussion     Email support