ScheduledTask

ScheduledTask[expr,timespec]
represents a scheduled task to be evaluated on the schedule defined by timespec.

Details and OptionsDetails and Options

  • CloudDeploy[ScheduledTask[]] sets up a scheduled task in the cloud.
  • Scheduled tasks in the cloud can be controlled using functions like StopScheduledTask and StartScheduledTask.
  • The following timespec specifications can be given:
  • "Hourly"run once an hour
    "Daily"run once a day
    "Weekly"run once a week
    "Monthly"run once a month
    "Yearly"run once a year
    dtrun at a specified time interval
    DateObject[patt]run at times matching the specified pattern
    {timespec}run only once ever
    {timespec,count}run only count times ever
    "cronspec"run at times specified by a Unix cron specification
  • The time interval dt should be given as a Quantity object.
  • In DateObject[patt], the pattern patt has the form , where later elements can be dropped, and where each element can be a literal integer, a choice of integers of the form , or representing any possible value. For the day element, literal days can be replaced by symbols indicating a day of the week, such as Monday.
  • The following options can be given:
  • NotificationOptions{{$WolframID}All}addresses for task status notifications and preferred conditions
    TimeZoneAutomatictime zone for scheduling
  • Supply NotificationOptions in the form , where the notification conditions may be any of the following:
  • Allnotify on success and failure
    $Failednotify on failure only
    Noneno notification
  • Failure conditions are met if the task output is $Failed or a Failure object.
  • In the cloud, the precise times at which scheduled tasks are run are typically determined by load-balancing requirements.
  • The minimum time between repetitions of a task in the cloud is determined by cloud configuration and policies and will typically be a certain fraction of an hour.

ExamplesExamplesopen allclose all

Basic Examples  (2)Basic Examples  (2)

Create a scheduled cloud task that logs the date and temperature hourly:

In[1]:=
Click for copyable input
Out[1]=

Create a scheduled cloud task that updates a time stamp in the cloud once a day:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
In[3]:=
Click for copyable input

Get the current time stamp:

In[4]:=
Click for copyable input
Out[4]=

Run the scheduled task cloud object using RunScheduledTask:

In[5]:=
Click for copyable input

The time stamp has been updated:

In[6]:=
Click for copyable input
Out[6]=

Delete the task:

In[7]:=
Click for copyable input
Out[7]=
Introduced in 2014
(10.0)
| Updated in 2014
(10.0.2)