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

Database 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: database
bak_type = "db"

# 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 = "localhost"
mysql_port = 3306
mysql_user_name = "root"
mysql_pwd = "root"
# mysqldump tool path
mysqldump_path = "/usr/local/bin/mysqldump"
skip_ssl = true
# docker_container_name = "non-exists-name" # When commenting on this line (None), the local mysqldump command is used, otherwise the docker exec command will be executed
# 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

# Database Backup Precheck
peppykeep backup run --bak-type db --config-home ~/.peppykeep/conf

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

admindeMac-mini-2:ldpt admin$ peppykeep backup run --bak-type db
=== Dry Run ===
Action     : backup run
Project    : test_717_file
BakType    : Db
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
ProjectItem identifier currently backed up: test_717_file
BakTypeBackup type: Db (database only)
DataDirApp data directory (data_dir in prj.toml)
LocationStorage location: Local (local only)
EncryptionEncryption enabled: false (no)
ForceForce override: false (no)
NextNext Action Tip: Re-run with --apply to execute. (need to add --apply parameter to execute)

Perform a backup

Performing a Database Backup

peppykeep backup run --apply --bak-type db --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  : Db
DataDir  : /tmp/test_file_717
Location : Local
Force    : false
Artifact : /tmp/backup/peppykeep/test_717_file/test_717_file-bak_20260703_171840.ppk
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
BakTypeBackup data type:
• Db — Backup database only
• AppData — Backup file data only
• DbAndAppData — Backup both database and file data
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
bak_type = "db"

# Backups are also saved locally
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]
Database Host
mysql_ip = "192.0.2.10"
Database Port
mysql_port = 3306
Databse username
mysql_user_name = "remote_user"
Database Pass
mysql_pwd = "root"
# mysqldump tool path
mysqldump_path = "/opt/homebrew/bin/mysqldump"
# 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

# Database Backup Precheck
peppykeep backup run --bak-type db --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    : Db
DataDir    : /tmp/test_file_717
Location   : LocalAndRemote
Encryption : false
Force      : false
Next       : Re-run with --apply to execute.

Result

FieldDescription
ActionType of operation performed: backup run
ProjectItem identifier currently backed up: test_717_file
BakTypeBackup type: Db (database only)
DataDirApp data directory: /tmp/test_file_717
LocationStorage location: LocalAndRemote (Local + Object Storage)
EncryptionEncryption enabled: false (no)
ForceForce override: false (no)
NextNext Action Tip: Re-run with --apply to execute. (need to add --apply parameter to execute)

Perform a backup

Performing a Database Backup

peppykeep backup run --apply --bak-type db --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      : Db
DataDir      : /tmp/test_file_717
Location     : LocalAndRemote
Force        : false
Artifact     : /tmp/backup/peppykeep/test_717_file/test_717_file-bak_20260703_172943.ppk
Bucket       : VoosTestBucket
RemoteKey    : test_local_voos/test_717_file/test_717_file-bak_20260703_172943.ppk
Provider     : s3
Target       : s3://VoosTestBucket/test_local_voos/test_717_file/test_717_file-bak_20260703_172943.ppk
LocalCleanup : applied
Status       : Command completed successfully.

Result

FieldDescription
ActionType of operation performed: backup run
ProjectItem identifier currently backed up: test_717_file
BakTypeBackup type: Db (database only)
DataDirApp data directory: /tmp/test_file_717
LocationStorage location: LocalAndRemote (Local + Object Storage)
ForceForce override: false (no)
ArtifactLocal backup product path: /tmp
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)

Order Details Reference