Description
A Scheduled Task is a script stored in the Scheduled Tasks location that contains one or more //@schedule directives. The tasks are run on the server according to the specified schedule. The server refreshes the task's schedule every time the task script is updated.
//@schedule Directive Syntax
Scheduling
At certain intervals:
//@schedule every hhh[:mm][:ss]
Daily (or every few days):
//@schedule every [n] day[s] at timeofday
On certain days of week:
//@schedule every dayofweek at timeofday
On certain days of week or days of a certain month:
//@schedule every month on dayofweek|dayofmonth at timeofday
File System Watching
On changes of FileSystem location:
//@watch folder "{Jobs}"
Disabling
Disabling all the schedules in the file:
//@schedule disable
Parameters
Property | Values | Notes |
---|---|---|
month | January | February | March | April | May | June | July | August | September | October | November | December | Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec |
A month name, range or a list (see examples below) |
dayofweek | Su | Mo | Tu | We | Th | Fr | Sa | Sun | Mon | Tue | Wed | Thu | Fri | Sat | Sunday | Monday | Tuesday | Wednesday | Thursday | Friday | Saturday |
Day of week, range or a list (see examples below) |
dayofmonth | 1..31 | Day of month, range or a list (see examples below) |
timeofday | hh[:mm][:ss][AM|PM] | Time of day or a list (see examples below) |
hhh | 0.. | A non-negative number of hours |
hh | 0..23 or 1..12 if AM|PM is specified | An hour of the day |
mm | 0..59 | A minute of an hour/a non-negative number of minutes |
ss | 0..59 | A second of a minute/a non-negative number of seconds |
n | 1.. | A positive number |
All the keywords are case-insensitive.
Examples
A task running every 5 minutes
A task running every day at 9:00 PM
A task running every Saturday at 1:00 AM
A task running on Saturday and Sunday
Multiple schedules are also allowed
A rather convoluted example, for the sake of it
A task running in March, June, July and August from 10 to 13 and then from 20 to 25 at 1:31 AM and 6:28 PM:
Disabling/commenting out a schedule
You can add a disable directive to disable all the schedules in the file:
or you can simply comment out a particular schedule directive: