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

Docker Backup

Backup to local

enforce_provisioning_action

  1. app.toml
# Log storage directory/tmp (allow to be followed by any subdirectory)
dir = "/tmp/log/peppykeep"

# Log file name (full path:/tmp/log/peppykeep/app.log)
file_name = "app.log"

# Level: error, warn, info, debug, trace Log level is debug (output all debug information)
level = "debug"

点击查看详情

  1. bak.toml
# Backup type is docker backup
bak_type = "db_and_app_data"

# Backups are also saved locally
bak_location_type = "local"

# Keep last n historical backups locally
history_bak_num = n

# Log level is debug mode (outputs the most detailed logs)
log_level = "DEBUG"

# Log storage directory/tmp (allow to be followed by any subdirectory)
log_dir = "/tmp/logs/peppykeep"

# Local backup storage home directory/tmp (allow to be followed by any subdirectory)
local_bak_home = "/tmp/backup/peppykeep"

# Local Temporary Working Directory/tmp (allows any subdirectory to follow)
local_tmp_home = "/tmp/.peppykeep_tmp"

# The maximum length of the backup queue is 1 (serial execution, no concurrency)
max_bak_queue_size = 1

# Backup Encryption Configuration
[backup_encryption]
# Turn off encryption
enabled = false

[mysql]
mysql_ip = "127.0.0.1"
mysql_port = 3306
mysql_user_name = "root"
mysql_pwd = "root"
# mysqldump tool path
mysqldump_path = "/usr/bin/mysqldump"
skip_ssl = true
docker_container_name = "ppk-mysql-test"
# Docker Command Path (for containerized backups)
docker_cmd_path = "/usr/bin/docker"

点击查看详情

  1. prj.toml
# Project identifiers for relative path and directory identification
prj_key = "test_717_file"
# Local data storage directory (temporary path, configurable)
data_dir = "/tmp/test_file_717"

点击查看详情

Perform the preliminary checks: §.

Open Terminal Execution

# docker Backup Precheck (Database + App Catalog)
peppykeep backup run --bak-type db-and-app-data --config-home ~/.peppykeep/conf

When the pre-test is successful, the output is as follows:

=== Dry Run ===
Action     : backup run
Project    : test_717_file
BakType    : DbAndAppData
DataDir    : /tmp/test_file_717
Location   : Local
Encryption : false
Force      : false
Next       : Re-run with --apply to execute.

Result

FieldDescription
ActionType of operation performed: backup run
ProjectIdentification of the currently backed up item
BakTypeDbAndAppData means that both MySQL and App Catalog in the container are backed up
DataDirApp data directory, corresponding to data_dir of prj.toml
LocationStorage Location
EncryptionWhether encryption is enabled
ForceWhether to enforce
NextFormal execution after adding `--apply’

Perform a backup

Perform a docker backup

peppykeep backup run --bak-type db-and-app-data --apply --config-home ~/.peppykeep/conf

After executing the backup command, the output on success is as follows:

=== Completed ===
Action       : backup run
Project      : test_717_file
BakType      : DbAndAppData
DataDir      : /tmp/test_file_717
Location     : Local
Force        : false
Artifact     : /tmp/backup/peppykeep/test_717_file/test_717_file/test_717_file-bak_20260729_173824.ppke
ArtifactSize : 1.5 KiB
Status       : Command completed successfully.

Result

FieldDescription
ActionType of action performed, fixed asbackup run
ProjectIdentification of the currently backed up project, corresponding to prj_key in the project configuration file
BakTypeDbAndAppData — Backup both MySQL and App Catalog in the container
DataDirThe data source directory for this backup, corresponding to data_dir in the project configuration
LocationStorage location:
• Local — store to local only
• LocalAndRemote — store to both local and object storage object storage
ForceWhether to enforce (ignore some checks or warnings), true/false
ArtifactThe full storage path of the local backup file, with the file name format {projectID} -bak_{datetime} .ppk
StatusExecution status code:
• Command completed successfully. — Backup successful
• Command completed with errors. — Backup completed with errors (partial failure)
• Command failed. — Backup execution failed

Backup to Object Storage

enforce_provisioning_action

  1. app.toml
# Log storage directory/tmp (allow to be followed by any subdirectory)
dir = "/tmp/log/peppykeep"

# Log file name (full path:/tmp/log/peppykeep/app.log)
file_name = "app.log"

# Level: error, warn, info, debug, trace Log level is debug (output all debug information)
level = "debug"

点击查看详情

  1. bak.toml (S3 as an example)
# Backup Type: Database + App Catalog (Docker Scenario)
bak_type = "db_and_app_data"

# Save backups both locally and remotely
bak_location_type = "local_and_remote"

# Keep last n historical backups locally
history_bak_num = n

# Log level is debug mode (outputs the most detailed logs)
log_level = "DEBUG"

# Log storage directory/tmp (allow to be followed by any subdirectory)
log_dir = "/tmp/my_test_peppykeep/logs"

# Local backup storage home directory/tmp (allow to be followed by any subdirectory)
local_bak_home = "/tmp/my_test_peppykeep/backup"

# Local Temporary Working Directory/tmp (allows any subdirectory to follow)
local_tmp_home = "/tmp/my_test_peppykeep/.tmp"

# The maximum length of the backup queue is 1 (serial execution, no concurrency)
max_bak_queue_size = 1

[mysql]
# docker host
mysql_ip = "192.0.2.10"
# docker port
mysql_port = 3306
# dockerusername
mysql_user_name = "remote_user"
# docker Password
mysql_pwd = "root"
# mysqldump tool path
mysqldump_path = "/usr/bin/mysqldump"
docker_container_name = "ppk-mysql-test"
# Docker Command Path (for containerized backups)
docker_cmd_path = "/usr/local/bin/docker"

# Enable Object Storage
[object_storage]
enabled = true

# Using S3 protocol (Backblaze B2 compatible)
provider = "s3"

# Bucket Name
bucket = "TestBucket"

# Object key prefix (like folder path)
prefix = "test_local"

# S3 Compatible Endpoints (Backblaze B2 + East)
endpoint = "https://s3.xxxxxxxxxxxxxx.com"

Region
region = "ca-east-006"

Access Key ID
access_key_id = "xxxxxxxxxxxxxx"

Access key
access_key_secret = "xxxxxxxxxxxxxx"

# Use path style URL (bucket/object instead of web hosting style)
path_style = true

# Backup Encryption Configuration
[backup_encryption]
# Turn off encryption
enabled = false


点击查看详情

  1. prj.toml
# Project identifiers for relative path and directory identification
prj_key = "test_717_file"
# Local data storage directory (temporary path, configurable)
data_dir = "/tmp/test_data"

点击查看详情

Perform the preliminary checks: §.

Open Terminal Execution

# docker Backup Precheck (Database + App Catalog)
peppykeep backup run --bak-type db-and-app-data --config-home ~/.peppykeep/conf

When the pre-test is successful, the output is as follows:

=== Dry Run ===
Action     : backup run
Project    : test_717_file
BakType    : DbAndAppData
DataDir    : /tmp/test_data
Location   : LocalAndRemote
Encryption : false
Force      : false
Next       : Re-run with --apply to execute.

Result

FieldDescription
ActionType of operation performed: backup run
ProjectIdentification of the currently backed up item
BakTypeDbAndAppData means that both MySQL and App Catalog in the container are backed up
DataDirApp Data Catalog
LocationLocalAndRemote means local and object storage
EncryptionWhether encryption is enabled
ForceWhether to enforce
NextFormal execution after adding `--apply’

Perform a backup

Perform a docker backup

peppykeep backup run --bak-type db-and-app-data --apply --config-home ~/.peppykeep/conf

After executing the backup command, the output on success is as follows:

=== Completed ===
Action       : backup run
Project      : test_717_file
BakType      : DbAndAppData
DataDir      : /tmp/test_file_717
Location     : LocalAndRemote
Force        : false
Artifact     : /tmp/backup/peppykeep/test_717_file/test_717_file/test_717_file-bak_20260729_174638.ppke
ArtifactSize : 1.5 KiB
Bucket       : VoosTestBucket
RemoteKey    : test_717_file/test_717_file-bak_20260729_174638.ppke
Provider     : s3
Target       : s3://VoosTestBucket/test_717_file/test_717_file-bak_20260729_174638.ppke
LocalCleanup : applied
Status       : Command completed successfully.

Result

FieldDescription
ActionType of operation performed: backup run
ProjectItem identifier currently backed up: test_717_file
BakTypeDbAndAppData — Backup both MySQL and App Catalog in the container
DataDirApp Data Catalog
LocationLocalAndRemote
ForceWhether to enforce
ArtifactLocal Backup Product Path
BucketObject Storage Bucket Name: VoosTestBucket
RemoteKeyObject store stored file key-value path: test_local_voos/test_717_file/test_717_file-bak_20260702_104919.ppk
ProviderObject storage storage provider: s3
TargetObject store full destination address: s3://VoosTestBucket/test_local_voos/test_717_file/test_717_file-bak_20260702_104919.ppk
LocalCleanupLocal cleanup status: applied (executed)
StatusExecution Status: Command completed successfully. (Command executed successfully)