From d7017a8d3c39af6ea3b54a24c3bcbc81efbcf8a3 Mon Sep 17 00:00:00 2001 From: Thomas Tacquet Date: Wed, 26 Feb 2025 10:17:19 +0100 Subject: [PATCH 1/2] feat(serverles): add more cron in cheatsheet --- macros/serverless/cron-schedules.mdx | 29 +++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/macros/serverless/cron-schedules.mdx b/macros/serverless/cron-schedules.mdx index f4e32e4cd9..d4382e3458 100644 --- a/macros/serverless/cron-schedules.mdx +++ b/macros/serverless/cron-schedules.mdx @@ -10,11 +10,11 @@ Cron jobs are expressed using the `* * * * *` format, which corresponds to the f ``` ┌───────────── minute - │ ┌───────────── hour - │ │ ┌───────────── day of the month - │ │ │ ┌───────────── month + │ ┌───────────── hour + │ │ ┌───────────── day of the month + │ │ │ ┌───────────── month │ │ │ │ ┌───────────── day of the week - │ │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * * * * * @@ -50,6 +50,25 @@ Several operators can be added to each field to further refine your schedule. ## Cron schedule examples +### Simple + +Some examples of simple cron schedules expressions, useful for tasks like regular backups or file analysis. + +| Cron expression | Description | +|----------------------------|----------------------------------------------------------------| +| `* * * * *` | Runs every minute | +| `*/5 * * * *` | Runs every 5 minutes | +| `*/15 * * * *` | Runs every 15 minutes | +| `0 * * * *` | Runs every hour | +| `0 0 * * *` | Runs every day at midnight | +| `0 9 * * *` | Runs every day at 9:00 | +| `0 0 * * 0` | Runs every sunday at midnight | +| `0 0 1 * *` | Runs once a month at midnight | + +### Advanced + +Advanced example for more specific use cases. + | Cron expression | Description | |----------------------------|----------------------------------------------------------------| | `0 12 * * *` | Runs at 12:00 (noon) every day | @@ -68,4 +87,4 @@ Several operators can be added to each field to further refine your schedule. - Serverless Functions and Serverless Containers [CRON triggers](/serverless-functions/concepts#cron-trigger) use the **UTC** time zone. This parameter cannot be modified. -- Serverless Jobs allow modifying the time zone of their schedules via the Job **Settings** tab. Refer to [the job scheduling documentation](/serverless-jobs/how-to/manage-job-schedule/) for more information. \ No newline at end of file +- Serverless Jobs allow modifying the time zone of their schedules via the Job **Settings** tab. Refer to [the job scheduling documentation](/serverless-jobs/how-to/manage-job-schedule/) for more information. From 4e59bcd2dece43bcec58b01b6ba0587a9c25238b Mon Sep 17 00:00:00 2001 From: SamyOubouaziz Date: Wed, 26 Feb 2025 14:21:25 +0100 Subject: [PATCH 2/2] Update macros/serverless/cron-schedules.mdx --- macros/serverless/cron-schedules.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macros/serverless/cron-schedules.mdx b/macros/serverless/cron-schedules.mdx index d4382e3458..4057ed8f55 100644 --- a/macros/serverless/cron-schedules.mdx +++ b/macros/serverless/cron-schedules.mdx @@ -62,7 +62,7 @@ Some examples of simple cron schedules expressions, useful for tasks like regula | `0 * * * *` | Runs every hour | | `0 0 * * *` | Runs every day at midnight | | `0 9 * * *` | Runs every day at 9:00 | -| `0 0 * * 0` | Runs every sunday at midnight | +| `0 0 * * 0` | Runs every Sunday at midnight | | `0 0 1 * *` | Runs once a month at midnight | ### Advanced