SG SealGrid Athena Docs

Scheduled Jobs

A scheduled job runs an action on a schedule you define — once, on a repeating interval, or on a cron expression. Jobs can push a deployment, run a command, collect inventory, scan for Windows updates, or run a server-side maintenance task such as a database backup. Manage jobs from the console, the REST API, or the PowerShell module.

The Scheduler page in Athena
The Scheduler — recurring, cron, and one-time jobs targeting agents or the server, each with its next run and status.

How scheduling works#

Every scheduled job combines a schedule type (when it runs) with an action type (what it does). The server owns the timing, so jobs keep running on schedule independently of any console session — there is nothing to install on a workstation. Agent tasks (deployments, commands, inventory, update scans) run against the agents you target; server tasks (backups, cleanups, collection refresh) run on the Athena server itself and need no targets.

Managing scheduled jobs requires the Operator or Admin role; deleting a job requires Admin. See Roles & Permissions.

Schedule types#

Schedule typeRuns…Required field
OneTimeOnce, at a specific date and time.scheduledTime (must be in the future)
RecurringEvery fixed interval.intervalMinutes (a positive number)
CronOn a cron expression — for fixed clock times such as "daily at 02:00" or "every Sunday at 03:00".cronExpression

A OneTime job moves to the Completed status after it runs. A Recurring or Cron job keeps running until you pause or delete it.

Cron expressions#

Athena accepts the standard 5-field cron format (minute hour day-of-month month day-of-week). You can also supply a native 6- or 7-field expression if you need second-level precision. Some common patterns:

ExpressionMeaning
0 0 * * *Daily at midnight.
0 2 * * *Daily at 02:00.
0 3 * * 0Every Sunday at 03:00.
*/15 * * * *Every 15 minutes.

You can validate an expression before saving and get a human-readable description of it with GET api/scheduler/validate-cron?expression=…. The server returns whether the expression is valid, a plain-English description, and an error message when it is not.

Day-of-month and day-of-week

When you specify a particular day-of-month and a particular day-of-week in the same 5-field expression, Athena keeps the day-of-month and treats day-of-week as unrestricted. To schedule by weekday, leave day-of-month as * (for example 0 3 * * 0 for Sundays).

Action types#

Agent tasks act on endpoints and require at least one target — supplied as agent IDs (targetAgentIds) and/or tags (targetTags):

Action typeWhat it doesAlso requires
DeploymentRuns a deployment against the targets.deploymentId
CommandRuns a command on the targets.command (plus optional commandArguments)
InventoryCollectionCollects inventory from the targets.
WindowsUpdateScanScans the targets for missing Windows updates using the WSUS offline catalog.

Server tasks run on the Athena server and take no targets. They are intended for routine maintenance:

Action typeWhat it does
DatabaseBackupBacks up the Athena database. See Database Backup & Maintenance.
LogCleanupCleans up and rotates logs.
AgentsCleanupCleans up inactive agents.
CollectionRefreshRecomputes members of dynamic collections.
CommandsCleanupCleans up old commands and their results.
RustDeskPasswordRotationRotates remote-desktop passwords that are due.

Job status & lifecycle#

A scheduled job is always in one of four states, and the actions you can take depend on it:

StatusMeaningAllowed actions
ActiveWill run on its schedule.Update, pause, trigger now, delete.
PausedHeld; will not run until resumed.Update, resume, trigger now, delete.
DisabledTurned off.Delete.
CompletedA one-time job that has already run.Delete.

Pause applies only to an Active job; resume applies only to a Paused job; update and trigger now apply to Active or Paused jobs. Triggering a job runs it immediately without affecting its regular schedule. Each job tracks its next and last run time, run counts, and the last result so you can see at a glance whether it is healthy.

Creating a job via the API#

Post a job definition to POST api/scheduler/jobs. A cron-based deployment that runs daily at midnight against a tag:

POST /api/scheduler/jobs
{
  "name": "Nightly app rollout",
  "description": "Push the line-of-business app every night",
  "scheduleType": "Cron",
  "actionType": "Deployment",
  "cronExpression": "0 0 * * *",
  "deploymentId": "550e8400-e29b-41d4-a716-446655440000",
  "targetTags": ["workstations"]
}

A one-time command at a fixed maintenance window:

POST /api/scheduler/jobs
{
  "name": "Patch-window restart",
  "scheduleType": "OneTime",
  "actionType": "Command",
  "scheduledTime": "2026-01-15T02:00:00",
  "command": "shutdown /r /t 60",
  "targetTags": ["windows-servers"]
}

A server task — a weekly database backup — needs no targets:

POST /api/scheduler/jobs
{
  "name": "Weekly DB backup",
  "scheduleType": "Cron",
  "actionType": "DatabaseBackup",
  "cronExpression": "0 3 * * 0"
}

Scheduler endpoints#

Method & pathPurpose
GET api/scheduler/jobsList jobs (paginated; filter by status, type, search).
GET api/scheduler/jobs/{id}Get a single job.
POST api/scheduler/jobsCreate a job.
PUT api/scheduler/jobs/{id}Update an Active or Paused job.
DELETE api/scheduler/jobs/{id}Delete a job (Admin only).
POST api/scheduler/jobs/{id}/pausePause an Active job.
POST api/scheduler/jobs/{id}/resumeResume a Paused job.
POST api/scheduler/jobs/{id}/triggerRun the job now (does not change its schedule).
GET api/scheduler/jobs/{id}/historyExecution history (default 10 records; set count).
GET api/scheduler/statsJob counts for the dashboard.
GET api/scheduler/todayJobs whose next run is today.
GET api/scheduler/validate-cronValidate and describe a cron expression.

All scheduler endpoints require authentication; see the API Reference.

PowerShell#

The Athena PowerShell module manages scheduled jobs end to end:

# Create a recurring inventory collection every hour for two agents
New-AthenaScheduledJob -Name "Hourly inventory" -ScheduleType Recurring `
    -ActionType InventoryCollection -IntervalMinutes 60 `
    -TargetAgentIds @($agent1Id, $agent2Id)

# Create a daily deployment via cron, targeting a tag
New-AthenaScheduledJob -Name "Daily rollout" -ScheduleType Cron `
    -ActionType Deployment -CronExpression "0 0 * * *" `
    -DeploymentId $deploymentId -TargetTags @("workstations")

# Create a weekly server-side database backup (no targets needed)
New-AthenaScheduledJob -Name "Weekly DB backup" -ScheduleType Cron `
    -ActionType DatabaseBackup -CronExpression "0 3 * * 0"

Listing, filtering, and managing existing jobs:

# List jobs, with optional filters
Get-AthenaScheduledJob
Get-AthenaScheduledJob -Status Active
Get-AthenaScheduledJob -ActionType Deployment
Get-AthenaScheduledJob -Search "backup"

# Update, pause, resume, run now, and view history
Set-AthenaScheduledJob -Id $jobId -CronExpression "0 2 * * *"
Suspend-AthenaScheduledJob -Id $jobId   # pause
Resume-AthenaScheduledJob -Id $jobId
Start-AthenaScheduledJob -Id $jobId    # trigger now
Get-AthenaScheduledJobHistory -Id $jobId -Count 20

# Dashboard counts, and remove a job (Admin)
Get-AthenaSchedulerStats
Remove-AthenaScheduledJob -Id $jobId
Cmdlet verbs map to job actions

Suspend-AthenaScheduledJob pauses a job, Resume-AthenaScheduledJob resumes it, and Start-AthenaScheduledJob triggers an immediate run — the same operations as the /pause, /resume and /trigger endpoints above.