liveBook · Manning

Cron expression

As explained in Snowflake Data Engineering

A CRON expression is a scheduling syntax that specifies recurring execution times.

A CRON expression specifies recurring task execution by minute, hour, day of month, month, and day of week. In Snowflake, provide a time zone to make the schedule unambiguous. section 2.5

Apply a CRON schedule operationally:

  • Suspend the task before changing its schedule. section 2.5
  • Set the schedule with the CRON expression and time zone. section 2.5
  • Resume the task, then use TASK_HISTORY() to verify execution and the next scheduled time. section 2.5

Run every evening at 11 p.m.

The expression `0 23 * * * UTC` means minute 0, hour 23, every day of the month, every month, and every day of the week, using UTC. section 2.5

alter task PROCESS_ORDERS suspend;
alter task PROCESS_ORDERS
set schedule = 'USING CRON 0 23 * * * UTC';
alter task PROCESS_ORDERS resume;

Shows the complete suspend, alter, and resume sequence for applying a CRON schedule to a Snowflake task. section 2.5

How Snowflake Data Engineering covers it

How deep it goes
Defines five scheduling fields and a time zone, then demonstrates task alteration and execution verification.
Examples
Uses `0 23 * * * UTC` to schedule a task every evening at 11 p.m.
What it assumes
Assumes a Snowflake task exists and requires task alteration, suspension, resumption, and history-query operations.
What you can do after
Operate/configure Snowflake tasks with recurring schedules and verify their scheduled and completed executions.
How it connects
Connects task scheduling with data pipelines, time zones, task suspension, task resumption, and TASK_HISTORY().

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Snowflake Data Engineering. The section links point to the parts of the book it draws on.