From f402666be2de9de9cbf952407f6095052b193fb4 Mon Sep 17 00:00:00 2001 From: javier Date: Fri, 6 Feb 2026 16:42:50 +0100 Subject: [PATCH] making scheduler more visible --- documentation/operations/backup.md | 125 +++++++++++++++-------------- 1 file changed, 63 insertions(+), 62 deletions(-) diff --git a/documentation/operations/backup.md b/documentation/operations/backup.md index 32b2a0020..bb066ea39 100644 --- a/documentation/operations/backup.md +++ b/documentation/operations/backup.md @@ -85,66 +85,6 @@ Then run `BACKUP DATABASE;` in SQL. See [Run a backup](#run-a-backup) for detail ### Configure -#### Scheduled backups - -You can configure automatic scheduled backups using cron syntax. The example -below runs a backup every day at midnight UTC. - -```conf -backup.schedule.cron=0 0 * * * -backup.schedule.tz=UTC -``` - -##### Cron format - -QuestDB uses the standard **5-field cron format**: - -```text - FIELD VALUES SPECIAL CHARS -┌──────────── minute ───────── 0-59 ───────────── * , - / -│ ┌────────── hour ─────────── 0-23 ───────────── * , - / -│ │ ┌──────── day of month ─── 1-31 ───────────── * , - / L W -│ │ │ ┌────── month ────────── 1-12 or JAN-DEC ── * , - / -│ │ │ │ ┌──── day of week ──── 0-7 or SUN-SAT ─── * , - / L # -│ │ │ │ │ -* * * * * -``` - -Special character meanings: - -- `*` — matches any value -- `,` — separates multiple values (e.g., `1,15` for 1st and 15th) -- `-` — defines a range (e.g., `1-5` for Monday through Friday) -- `/` — specifies intervals (e.g., `*/15` for every 15 units) -- `L` — last day of the month, or last specific weekday (e.g., `5L` = last Friday) -- `W` — nearest weekday to the given day (e.g., `15W` = nearest weekday to the 15th) -- `#` — nth weekday of the month (e.g., `5#3` = third Friday) - -For day-of-week, 0 and 7 both represent Sunday; 1-6 represent Monday through Saturday. - -:::tip -Use [crontab.guru](https://crontab.guru/) to build and validate your cron expressions. -::: - -##### Timezone - -The `backup.schedule.tz` property accepts any valid -IANA timezone name -(e.g., `America/New_York`, `Europe/London`) or `UTC`. - -If `backup.schedule.tz` not specified, the default is `UTC`. - -##### Resetting schedule without restart - -The `backup.schedule.cron` and `backup.schedule.tz` settings can be modified in `server.conf` and hot-reloaded without -restarting the server: - -```questdb-sql -SELECT reload_config(); -``` - -You can also use this to enable and disable the schedule by adding or commenting out the `backup.schedule.cron` config setting. - #### Backup retention Control how many backups to keep before automatic cleanup removes older ones: @@ -171,8 +111,8 @@ specifies a directory for atomic write operations during backup. |----------|-------------|---------| | `backup.enabled` | Enable backup functionality | `false` | | `backup.object.store` | Object store connection string | None (required) | -| `backup.schedule.cron` | Cron expression for scheduled backups | None (manual only) | -| `backup.schedule.tz` | IANA timezone for cron schedule | `UTC` | +| `backup.schedule.cron` | Cron expression for [scheduled backups](#scheduled-backups) | None (manual only) | +| `backup.schedule.tz` | IANA timezone for cron [schedule](#scheduled-backups) | `UTC` | | `backup.cleanup.keep.latest.n` | Number of backups to retain | `5` | | `backup.compression.level` | Compression level (1-22) | `5` | | `backup.compression.threads` | Threads for compression | CPU count | @@ -231,6 +171,67 @@ To abort a running backup: BACKUP ABORT; ``` +### Scheduled backups + +You can configure automatic scheduled backups using cron syntax. The example +below runs a backup every day at midnight UTC. + +```conf +backup.schedule.cron=0 0 * * * +backup.schedule.tz=UTC +``` + +#### Cron format + +QuestDB uses the standard **5-field cron format**: + +```text + FIELD VALUES SPECIAL CHARS +┌──────────── minute ───────── 0-59 ───────────── * , - / +│ ┌────────── hour ─────────── 0-23 ───────────── * , - / +│ │ ┌──────── day of month ─── 1-31 ───────────── * , - / L W +│ │ │ ┌────── month ────────── 1-12 or JAN-DEC ── * , - / +│ │ │ │ ┌──── day of week ──── 0-7 or SUN-SAT ─── * , - / L # +│ │ │ │ │ +* * * * * +``` + +Special character meanings: + +- `*` — matches any value +- `,` — separates multiple values (e.g., `1,15` for 1st and 15th) +- `-` — defines a range (e.g., `1-5` for Monday through Friday) +- `/` — specifies intervals (e.g., `*/15` for every 15 units) +- `L` — last day of the month, or last specific weekday (e.g., `5L` = last Friday) +- `W` — nearest weekday to the given day (e.g., `15W` = nearest weekday to the 15th) +- `#` — nth weekday of the month (e.g., `5#3` = third Friday) + +For day-of-week, 0 and 7 both represent Sunday; 1-6 represent Monday through Saturday. + +:::tip +Use [crontab.guru](https://crontab.guru/) to build and validate your cron expressions. +::: + +#### Timezone + +The `backup.schedule.tz` property accepts any valid +IANA timezone name +(e.g., `America/New_York`, `Europe/London`) or `UTC`. + +If `backup.schedule.tz` not specified, the default is `UTC`. + +#### Resetting schedule without restart + +The `backup.schedule.cron` and `backup.schedule.tz` settings can be modified in `server.conf` and hot-reloaded without +restarting the server: + +```questdb-sql +SELECT reload_config(); +``` + +You can also use this to enable and disable the schedule by adding or commenting out the `backup.schedule.cron` config setting. + + ### Backup instance name Each QuestDB instance has a backup instance name (three random words like