# Scheduling backups and running manual backups

## Scheduling Backups

{% hint style="info" %}
**Please note:**

Since Brain functionality will limited during a backup run (see **What is unavailable during a a backup** in the [FAQ](https://docs.vectra.ai/operations/backup-restore-dr/backup-and-restore-v85/backup-and-restore-faq) section above), it is recommended to schedule backups for the time when your environment is least busy.
{% endhint %}

To set a backup schedule for Sundays at 11:00PM:

```language-markup
backup schedule enable --hour 23 --weekday sunday
```

Example output:

```language-markup
Scheduled backups enabled on Sundays at 23:00, CDT.
External target upload is disabled.
```

{% hint style="info" %}
**Please Note:**

The scheduled time is shown in the Brain's local time, but is stored in UTC time in the system. UTC time does not change with daylight savings time, so for the above example (CDT = UTC - 5), backups would happen at an hour earlier, at 22:00 CST during standard time (CST = UTC - 6).
{% endhint %}

To see the currently configured schedule:

```language-markup
show backup schedule
```

Example output:

```language-markup
Scheduled backups are enabled on Sundays at 23:00 CDT.
External target upload is disabled.
```

With the above schedule configuration, the backup will be local only. To enable upload to an external target (which must also be configured as shown in the Configuring External Targets section below), use the `--enable-external-upload` option as shown in the below example:

```language-markup
backup schedule enable --enable-external-upload
```

Disable it with `--disable-external-upload`:

```language-markup
backup schedule enable --disable-external-upload
```

Scheduled backups are disabled by default. If you enable them but later decide to disable them, scheduled backups may be disabled with the following command:

```language-markup
backup schedule disable
```

## Running Backups Manually

To backup locally (even if you have external targets configured):

```language-markup
backup run --local-only
```

The output would look similar to this (the version and date is embedded in the file name):

```language-markup
................................................................
Complete.
Saved system state to backup file migration-8.4.0-0-10941-20240412-0022.tar.gz.gpg
```

`migration` just means the same thing as `backup` and is inconsequential.

To run a backup that includes external targets,remove the `--local-only` option as seen in the below example:

```language-markup
backup run
...............................................................
Complete.
Saved system state to backup file migration-8.4.0-0-10941-20240412-0027.tar.gz.gpg
SCP Target vadmin@192.168.55.156:/tmp/tmpyp0za1yd: Upload succeeded.
SFTP Target vadmin@192.168.55.156:/tmp/tmp9p6bqa_c: Upload succeeded.
SFTP Target vadmin@192.168.55.156:/tmp/tmpiawxhaot, using password authentication: Upload succeeded.
S3 Target us-west-2 bucket vectra-test-8dcobsfuscatedbucketnamebecb8, path .: Upload succeeded.
Brain-to-Brain Target 192.168.55.156: Staging file succeeded.
```

In this case a local backup was run and then a copy was uploaded to all configured external targets. If there were any failures, the output would show this.
