Summary

The Arcana Scheduler does not have native support for running a program every X days. For example, there is no way to schedule a program to run every 10 days or every other week.

Using a script and the Arcana Scheduler API, however, it is possible to achieve the same effect.

More Information

The Arcana Scheduler API provides full programmatic control over the Scheduler, allowing you to change the the schedule for a program. Using the API it is therefore possible for the Scheduler to run a job that modifies its own schedule.

Download K00000218.zip and extract "adsxdays.vbs" to the Arcana Scheduler program directory (or any other convenient location). This script uses the API to change a job to run on the day that is X number of days from the current date. For example, if you run the script on February 1, it will reconfigure the job to run on February 15.

To use this script you must:

  1. Schedule your job to run on the first day you want it to execute.
  2. Use a batch file so that the Scheduler runs "adsxdays.vbs" in addition to your program.

Set the Initial Execution Date

To set the initial execution date, you need to set your program to run on a specified day in a specified month in a specified year, as shown in the following example. Also set the program to run at whatever time(s) on that day you wish.

Configure the Job to Run the Script

Suppose your Arcana Scheduler job originally ran the program "myprogram.exe". Instead of running "c:\programs\myprogram.exe" directly, you will change it to run a batch file that runs the adsxdays.vbs script and then runs your program. For example, change the "Application" from "c:\programs\myprogram.exe" to "c:\programs\runmyprogram.bat". Create "runmyprogram.bat" to appear as follows (assuming you want the job to run every 14 days):

cscript "c:\program files\arcana development\arcana scheduler\adsxdays.vbs" "Sample Job" 14
c:\programs\myprogram.exe

The adsxdays.vbs script requires two command-line parameters:

  • The name of the job to modify. The name is case-sensitive, so be sure to specify it exactly as it appears in the Scheduler. Also be sure to enclose the name in quotes if it contains spaces or punctuation.
  • The number of days in the future to schedule the job. If you specify "14", the job will be scheduled to run 14 days from the current date. Note that the schedule is always calculated based on the current date when the script runs, not on the last date the job was scheduled to run.

Test the Job

Now run your job from within the Scheduler. After it runs, display the job's properties again. You should see that the scheduled date has changed to the date two weeks from today.

Each time the job runs, it will reschedule itself.