> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/cortex-xsoar-8-on-prem/8.8/onboard-cortex-xsoar/back-up-and-restore-cortex-xsoar/run-backup-and-restore-operations-from-the-cli.md).

# Run backup and restore operations from the CLI

Run the following commands from your CLI to perform backup and restore operations. Backup can take several minutes.

| Command         | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| help            | <p>Shows a help menu on all available subcommands. You can also apply the <code>--help</code> flag on the subcommands to get more detailed specific information.</p><p><code>sudo /home/viewer/sbin/backup-cli --help</code></p><p>Output:</p><p><code>Backup and restore operations Usage: cortex-cli backup-restore \[command] Available Commands: backup Backup operations install Install backup components nfs-check Run NFS connectivity test restore Restore operations schedule Schedule operations Flags: -h, --help help for backup-restore Global Flags: --config string Path to configuration file --verbose Display verbose output</code></p>                                                                                                                                                                 |
| nfs-check       | <p>Checks if an NFS share can be mounted and verifies storage requirements for backup.</p><p><code>sudo /home/viewer/sbin/backup-cli nfs-check \[nfs-server-ip] \[nfs-path] \[size-limit (GB)]</code></p><p>Example:</p><p><code>sudo /home/viewer/sbin/backup-cli nfs-check 1.1.1.1 /some/path/to/nfs/ 1024</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| schedule create | <p>Configures an automated backup schedule for the creation and removal of old backups. Only one (or zero) backup schedule can run at any given time.</p><p>The schedule syntax is in crontab notation (<a href="https://crontab.guru/"><https://crontab.guru/></a>) which must be in quotes (see the example). Backup retention time is provided in units of days. For example, 5 for keeping each backup for five days before it is automatically deleted.</p><p><code>sudo /home/viewer/sbin/backup-cli schedule create \[schedule cron expression] \[ttl in day units]</code></p><p>Example:</p><p><code>sudo /home/viewer/sbin/backup-cli schedule create "30 13 \* \* \*" 5</code></p><p>Example output:</p><p><img src="/files/ReF7iNOr6bZYIqq8Fnwr" alt="opp-backup-schedule.png"></p>                             |
| schedule show   | <p>Shows the details of an existing scheduled backup.</p><p><code>sudo /home/viewer/sbin/backup-cli schedule show</code></p><p>Example output:</p><p><img src="/files/ReF7iNOr6bZYIqq8Fnwr" alt="opp-backup-schedule.png"></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| schedule delete | <p>Deletes the existing backup schedule.</p><p><code>sudo /home/viewer/sbin/backup-cli schedule delete</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| backup list     | <p>Prints a list of all backup attempts and their statuses.</p><p><code>sudo /home/viewer/sbin/backup-cli backup list</code></p><p>Example output:</p><p><img src="/files/a72cTYqGsHDsKvcKiC8a" alt="opp-backup-list.png"></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| delete          | <p>Deletes an existing backup by name.</p><p><code>sudo /home/viewer/sbin/backup-cli backup delete \[backup-name]</code></p><p>Example:</p><p><code>sudo /home/viewer/sbin/backup-cli backup delete xsoar8-7-0-12-20240819050051</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| restore         | <p>Runs a system restore from a previous backup.</p><p>Backups can be restored only if the current version of Cortex XSOAR is the same version as the backup.</p><p>You can copy the backup name from the backup list.</p><div data-gb-custom-block data-tag="hint" data-style="warning" class="hint hint-warning"><p><strong>Caution</strong></p><p>Rolling back to an existing restore point will shut down Cortex XSOAR for several minutes.</p></div><p><code>sudo /home/viewer/sbin/backup-cli restore \[backup-name]</code></p><p>Example:</p><p><code>sudo /home/viewer/sbin/backup-cli restore xsoar8-7-0-12-20240818050050</code></p>                                                                                                                                                                             |
| history         | <p>Prints a history of all attempted restore operations.</p><p><code>sudo /home/viewer/sbin/backup-cli restore history</code></p><p>Output example:</p><p><code>2024-10-21 22:44:54 backup ── TASK \[Restore show history] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 2024-10-21 22:44:54 backup ── ok: \[1-1-1-1] => 2024-10-21 22:44:54 backup ── restore\_history.stdout\_lines: 2024-10-21 22:44:54 backup ── - NAME BACKUP STATUS STARTED COMPLETED ERRORS WARNINGS CREATED SELECTOR 2024-10-21 22:44:54 backup ── - xsoar8-8-0-30-20241021203527-20241021211652 xsoar8-8-0-30-20241021203527 Completed 2024-10-21 21:16:52 +0000 UTC 2024-10-21 21:25:47 +0000 UTC 0 15 2024-10-21 21:16:52 +0000 UTC \<none> 2024-10-21 22:44:54 backup ──</code></p> |
| uninstall       | <p>Removes all backup components and disconnects from the configured NFS server.</p><div data-gb-custom-block data-tag="hint" data-style="warning" class="hint hint-warning"><p><strong>Warning</strong></p><p>Running <code>uninstall</code> deletes existing backup data.</p></div><p>To reconfigure NFS access details on the Cortex XSOAR cluster side, run the <code>uninstall</code> command and then run the <code>install</code> command.</p><p><code>sudo /home/viewer/sbin/backup-cli uninstall</code></p>                                                                                                                                                                                                                                                                                                       |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cortex-docs.paloaltonetworks.com/cortex-xsoar-8-on-prem/8.8/onboard-cortex-xsoar/back-up-and-restore-cortex-xsoar/run-backup-and-restore-operations-from-the-cli.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
