Skip to content
SHC Docs

shc backup create

create a backup

Create a backup of the current deployment (or the one named with --stack) into the cluster’s backup repository, where scheduled backups go, and the only place they go. --file instead writes a one-off .bak archive to the path you name (a directory, or a full path): a portable artifact that is not indexed, not encrypted, not swept by retention, and yours to look after. There is no default folder for it. A one-off .bak supports exactly three things: restore directly from it (shc backup restore --file <archive>), hand it to someone, or ingest it back into the indexed store (shc backup import <archive>). --all-connected backs up every deployment its integrations connect it to, through any number of plugs in either direction: its providers, their other consumers and so on, all in the deployment’s tenant, plus a provider it uses in another tenant. --with-dependants backs up the deployment and the deployments plugged into it as consumers. Each produces one consistency group. Note: --all-connected and --with-dependants back each member up into backup.repo (encrypted; they refuse without backup.password) and then write one .bkg bundling them to <state_home>/exports/.bkg. That bundle is a decrypted copy of every member, an app together with its database, kept readable only by its owner and never pruned by retention. It exists so shc recover --file <consistency-id>.bkg works on a cluster with a different key; if you do not need that, the same group is already in the repository and shc recover --consistency-id <consistency-id> reads it from there, encrypted. Delete the .bkg once you are done with it. Run shc doctor run for the estate’s backup posture and shc backup ls -o json for each archive’s own encryption and location. Containers are paused for the snapshot (up to --timeout seconds); a freeze held past timeouts.quiesce_hold escalates to stopping the deployment so the capture reads halted containers, and --fail aborts instead of stopping. --secrets-password seals the backup’s secrets under a password of your choice so it can be restored on a cluster whose vault master differs. --secrets-password-file reads it from a file, the same file shc backup restore --secrets-password-file opens the backup with.

shc backup create [stack] [flags]
shc backup create myblog
shc backup create -s myblog --name pre-upgrade --fail
shc backup create -s myblog --file ./myblog.bak --secrets-password s3cret
shc backup create -s myblog --secrets-password-file ./secrets.pw
shc backup create -s mydb --all-connected
--all-connected back up every deployment connected to this one through its integrations, in its tenant, as one group
-x, --exclude string comma-separated list of exclude patterns
--fail abort instead of stopping the deployment when the freeze outruns timeouts.quiesce_hold
--file string write a one-off .bak here instead of into the repository (a directory, or a full path); no default folder exists
-h, --help help for create
-n, --name string custom name for the backup
-p, --paths string restrict the backup to comma-separated subjects: a mount name, data/<mount>, @converter with its @, or the deployment's own directory; a subject the deployment does not have is refused before anything is captured
--secrets-password string encrypt the backup's vault secrets under this password instead of the vault master (lets the backup be restored where the master differs)
--secrets-password-file string read --secrets-password from this file, which holds one password
-s, --stack string stack name (overrides ctx)
--timeout float seconds to spend acquiring the pause; 0 takes the configured timeouts.quiesce, or this deployment's backup.yaml override
--with-dependants back up this deployment and the deployments plugged into it as consumers, as one group
--config stringArray extra YAML config file to layer on top of auto-discovered config; repeatable, later files win
-d, --debug enable debug mode (default: $SHC_DEBUG)
-e, --environment string environment name (default: "prod", or "default" on an estate with no licence and no trial; $SHC_ENVIRONMENT and shc ctx -e override it, and the "master" tenant is always "default")
--fields string comma-separated columns/keys to show (and their order)
--filter string comma-separated dotted paths to keep (drops everything else)
-o, --output string output format: tty|text|json|yaml (default: $SHC_OUTPUT)
-t, --tenant string tenant name (default: $SHC_TENANT)
-v, --verbose verbose output (default: $SHC_VERBOSE)