Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

backup run

Perform a full backup process. Depending on the configuration, this may include application data backups, database backups, compression, encryption, uploads, and local history cleanup.

Command Format:

peppykeep backup run [OPTIONS] [--apply] [--config-home <DIR>]

Description

General

  • --force: parameter reserved in the command help.
  • --data-dir<DIR>: Temporarily overrideslocal.data_dirinprj.toml.
  • --upload: temporary overlay is generated locally to continue uploading.
  • --no-upload: temporary overwrite to keep only local files.
  • --apply: really performs the backup; only checks when the parameter is not taken.
  • --config-home<DIR>: configuration directory.

Backup Type Override Parameters

  • --bak-type<db|app-data|db-and-app-data>: Temporarily overridespublic.bak_typeinbak.toml.
  • --db-type<mysql|postgres|oracle|mongodb|sqlite|unspecified>: Temporarily overridespublic.db_typeinbak.toml.

Project Coverage Parameters

  • --project-key<KEY>: Temporarily overrideslocal.prj_keyinprj.toml.
  • --mysql-db-name<NAME>: Temporarily overrideslocal.mysql_db_nameinprj.toml.

MySQL Override Parameters

  • --mysql-ip <IP>
  • --mysql-port <PORT>
  • --mysql-user-name <NAME>
  • --mysql-pwd <PASSWORD>
  • --mysqldump-path <PATH>

Object Storage Override Parameters

  • --provider <TYPE>
  • --bucket <NAME>
  • --prefix <PREFIX>
  • --endpoint <URL>
  • --region <REGION>
  • --access-key-id <KEY_ID>
  • --access-key-secret <KEY_SECRET>
  • --path-style

Usage Sample

peppykeep backup run --config-home additional/conf/dev
peppykeep backup run --apply --config-home additional/conf/dev
peppykeep backup run --apply --config-home /path/to/user/.peppykeep/u2-tmp --data-dir /your/data/dir
peppykeep backup run --apply --config-home /path/to/user/.peppykeep/u2-tmp --upload
peppykeep backup run --apply --config-home /path/to/user/.peppykeep/u2-tmp --no-upload
peppykeep backup run --apply --config-home additional/conf/dev --bak-type db-and-app-data --db-type mysql
peppykeep backup run --apply --config-home additional/conf/dev --project-key u2 --mysql-db-name u2db
peppykeep backup run --apply --config-home additional/conf/s3 --provider s3 --bucket <your_bucket> --endpoint https://s3.xxx-xxx.xxx.com --region xxx-xxx --path-style

Behaviour description

  • Without --apply, output the project and backup type that will be executed this time.
  • With --apply, enter the actual backup process.
  • .ppke is generated when backup_encryption.enabled = true is enabled.
  • Do not upload automatically when configured to keep only local files.
  • When configured for both local and remote retention, the object store is automatically uploaded after the file is generated.
  • When the override parameter is passed in, the command parameter is preferred; when it is not passed in, the configuration in prj.toml and bak.toml is read.
  • Before and after uploading, provider, bucket, remote key and the target object address are output for easy checking of the results.

backup run --upload does not automatically clean up remote historical backups. Remote cleanup requirescleanup object-storageto be performed separately.

Step-by-step execution

If you need to generate an encrypted file locally, manually confirm it, and then upload it separately, you can do it in the following order:

peppykeep backup run --apply --config-home /path/to/user/.peppykeep/u2-tmp
peppykeep backup run --apply --config-home /path/to/user/.peppykeep/u2-tmp --data-dir /你的/实际目录
peppykeep backup run --apply --config-home /path/to/user/.peppykeep/u2-tmp --no-upload
peppykeep backup upload-artifact --apply --input-file /path/to/user/bak_u2/u2/你的文件名.ppke --config-home /path/to/user/.peppykeep/u2-tmp

Dependent Configuration

  • prj.toml
  • bak.toml
  • Use backup encryption for configuration and public key files when encryption is enabled
  • Use [object_storage] configuration when enabling automatic uploads