# Configure and monitor scheduled backups

> Create a cron-style backup rule with a retention count, run it on demand, and confirm from the rule card that backups are succeeding.

Scheduled backups run automatically on a cron-style schedule and keep a rolling set of recent backup files, so a recent configuration exists to restore from without you having to remember to export one manually.

![Settings, Backups: the Scheduled Backups page with Add Backup Rule above a rule card named Nightly backup, marked Enabled, showing its schedule, last successful run and number of files to keep, with Edit and Remove buttons](https://bitfocus.io/api/docs-media/file/scheduled-backups.png?prefix=docs-media)

## Before you begin

- Access to **Settings → Backups**.
- A destination path to store backups, if you're not using the default location (not available in a High Availability deployment, which always uses the default location).
- A sense of how many recent backups you want retained.

## Create a backup rule

1. Open **Settings → Backups** and select **Add Backup Rule**. Buttons creates a rule called **New Backup Rule** straight away and opens it in **Edit Backup Rule**, so each click adds another rule.
2. Enter a **Rule Name**.
3. Make sure the rule is switched to **Enabled**: a **Disabled** rule doesn't run.
4. Set the secrets switch to **Include secrets** or **Exclude secrets**: this controls whether the connection secret vault is bundled into each backup this rule produces.
5. Set the **Cron Schedule**: pick a frequency preset (Daily, Weekly, Monthly, Yearly) or build a custom schedule. A human-readable summary of the schedule is shown as you build it.
6. Set the **Backup Path**, if you want somewhere other than the [default location](#default-backup-location).
7. Set a **Backup Name Pattern**: this supports date/time substitutions (year, month, day, hour, minute, second) so successive backups get distinct filenames.
8. Set **Number of Backups to Keep**: a count from 1 to 100. Once a rule has produced more backups than this, the oldest are removed automatically. Retention is count-based only: there's no separate age-based expiry.
9. Select **Save**.

## Default backup location

When **Backup Path** is left empty, Buttons saves backups to a `backups` folder inside its data folder on the Buttons host:

| Platform | Default backup folder |
| --- | --- |
| macOS | `~/Library/Application Support/Bitfocus Buttons/data/backups` |
| Windows | `%APPDATA%\Bitfocus\Buttons\data\backups` |
| Linux | `~/.config/bitfocus-buttons/data/backups` |

The folder belongs to the user account that runs Buttons. On a Linux service install, that's the `buttons` system user, so the folder is under that user's home directory rather than yours.

## Run a backup immediately

Open the rule with **Edit** and select **Run Now**, next to **Rule Name**, to trigger a backup right away, independent of its schedule: useful before a risky change, or to confirm a new rule actually works.

**Run Now** uses the rule's saved settings, so select **Save** first after any change, including for a new rule. It's unavailable while the rule is **Disabled**.

## Monitor whether backups are succeeding

Each rule's card shows its schedule summary, **Last successful run** (or **Never**), how many files it's currently keeping, and (only if its most recent run failed) a **Last run error** message. The same error appears in a **Last run failed** box at the top of **Edit Backup Rule**. There's no separate per-run history log beyond this: a rule with no error shown and a recent **Last successful run** date is working; a file actually appearing in **Previous Backups** is itself confirmation that run succeeded.

## Remove a rule

Select **Remove** on the rule's card and confirm. This deletes only the rule: backup files it already made stay in the backup folder, and you'd need to delete those yourself if you no longer want them.

## Restore from a backup

Open the rule with **Edit** to see its backup files under **Previous Backups**, each with a restore icon. Restoring replaces all current configuration and restarts Buttons: see [Restore a backup and verify it](/docs/buttons/v1.10/administration/restore-and-verify) for the steps, what happens if a restore fails, and what to check before returning to service.

## If you get stuck

| What you see | What to try |
| --- | --- |
| A rule shows **Last run error**. | Read the error message on the rule's card: check the backup path is reachable and writable, and that the schedule and retention settings are valid. |
| Backups aren't appearing on schedule. | Confirm the rule is enabled, not just created: a disabled rule won't run. |
| You're not sure a rule actually works. | Save the rule, select **Run Now**, and confirm a new file appears in **Previous Backups**. |
| **Run Now** ignored the changes you just made, or is greyed out. | Select **Save** first: **Run Now** uses the saved rule. It's also unavailable while the rule is **Disabled**. |
| There's an extra rule called **New Backup Rule**. | Each **Add Backup Rule** click creates a rule straight away. Remove the one you don't need. |
| You want to verify a backup is restorable before you need it. | There's no built-in test-restore: the only way to confirm is a real restore, which replaces current configuration. Plan accordingly, for example by testing against a non-production instance. |
| Old backups aren't being cleaned up. | Check **Number of Backups to Keep**: cleanup is count-based, so a high number keeps files around longer than you might expect. |

## Where to go next

- [Store and rotate connection secrets](/docs/buttons/v1.10/administration/secrets), for what happens to a secret-bound field when a backup excludes secrets.
- [Export or import Buttons configuration](/docs/buttons/v1.10/administration/configuration-import-export), for manual, one-off exports outside the scheduled rules.
- [Secure a Buttons deployment](/docs/buttons/v1.10/security/secure-buttons), for backup handling as part of a broader security baseline.
- [Back up and recover a High Availability deployment](/docs/buttons/v1.10/administration/ha-backup-and-recovery), if you're running Buttons as an HA deployment.
