Compare commits

..

3 Commits

Author SHA1 Message Date
6bcc5d6bd4 Merge pull request #184 from jkaninda/docs
Some checks failed
Deploy Documenation site to GitHub Pages / build (push) Failing after 9m27s
Deploy Documenation site to GitHub Pages / deploy (push) Has been skipped
Lint / Run on Ubuntu (push) Successful in 18m36s
Tests / test (push) Failing after 18s
doc: update configuration deployment
2025-03-16 05:55:14 +01:00
fd35fabf97 doc: update configuration deployment 2025-03-16 05:45:12 +01:00
e666466d27 fix: database name not set error when using flag -d (#183)
Some checks failed
Lint / Run on Ubuntu (push) Successful in 18m39s
Tests / test (push) Failing after 13s
* fix: database name not set error when using flag -d
2025-03-14 14:38:06 +01:00
6 changed files with 8 additions and 8 deletions

View File

@@ -182,8 +182,7 @@ jobs:
-e DB_USERNAME=user \ -e DB_USERNAME=user \
-e DB_PASSWORD=password \ -e DB_PASSWORD=password \
-e GPG_PASSPHRASE=password \ -e GPG_PASSPHRASE=password \
-e DB_NAME=testdb \ ${{ env.IMAGE_NAME }}:latest backup -d testdb --disable-compression --custom-name encrypted-bkup
${{ env.IMAGE_NAME }}:latest backup --disable-compression --custom-name encrypted-bkup
echo "Database encrypted backup completed" echo "Database encrypted backup completed"
- name: Test restore encrypted backup | testdb -> testdb2 - name: Test restore encrypted backup | testdb -> testdb2
run: | run: |

View File

@@ -37,7 +37,7 @@ It supports a variety of storage options and ensures data security through GPG e
## Use Cases ## Use Cases
- **Automated Recurring Backups:** Schedule regular backups for MySQL databases. - **Automated Recurring Backups:** Schedule regular backups for MySQL databases.
- **Cross-Environment Migration:** Easily migrate your MySQL databases across different environments using supported storage options. - **Cross-Environment Migration:** Easily migrate MySQL databases across different environments using `migration` feature.
- **Secure Backup Management:** Protect your data with GPG encryption. - **Secure Backup Management:** Protect your data with GPG encryption.

View File

@@ -7,7 +7,7 @@ nav_order: 12
# Backup All Databases # Backup All Databases
MySQL-Bkup supports backing up all databases on the server using the `--all-databases` (`-a`) flag. By default, this creates separate backup files for each database. If you prefer a single backup file, you can use the `--all-in-on`e (`-A`) flag. MySQL-Bkup supports backing up all databases on the server using the `--all-databases` (`-a`) flag. By default, this creates separate backup files for each database. If you prefer a single backup file, you can use the `--all-in-one` (`-A`) flag.
Backing up all databases is useful for creating a snapshot of the entire database server, whether for disaster recovery or migration purposes. Backing up all databases is useful for creating a snapshot of the entire database server, whether for disaster recovery or migration purposes.
## Backup Modes ## Backup Modes
@@ -21,7 +21,7 @@ Using --all-databases without --all-in-one creates individual backup files for e
- Can be more manageable in cases where different databases have different retention policies. - Can be more manageable in cases where different databases have different retention policies.
- Might take slightly longer due to multiple file operations. - Might take slightly longer due to multiple file operations.
- It is the default behavior when using the `--all-databases` flag. - It is the default behavior when using the `--all-databases` flag.
- It does not backup system databases (`information_schema`, `performance_schema`, `mysql`, `sys`, `innodb`). - It does not backup system databases (`information_schema`, `performance_schema`, `mysql`, `sys`, `innodb`,...).
**Command:** **Command:**

View File

@@ -19,7 +19,7 @@ The configuration file can be mounted into the container at `/config/config.yaml
### Key Features: ### Key Features:
- **Global Environment Variables**: Use these for databases that share the same configuration. - **Global Environment Variables**: Use these for databases that share the same configuration.
- **Database-Specific Overrides**: Override global settings for individual databases by specifying them in the configuration file or using the database name as a suffix in the variable name (e.g., `DB_HOST_DATABASE1`). - **Database-Specific Overrides**: Override global settings for individual databases by specifying them in the configuration file or using the database name as a prefix or suffix in the variable name (e.g., `DB_HOST_DATABASENAME` or `DATABASENAME_DB_HOST`).
- **Global Cron Expression**: Define a global `cronExpression` in the configuration file to schedule backups for all databases. If omitted, backups will run immediately. - **Global Cron Expression**: Define a global `cronExpression` in the configuration file to schedule backups for all databases. If omitted, backups will run immediately.
- **Configuration File Path**: Specify the configuration file path using: - **Configuration File Path**: Specify the configuration file path using:
- The `BACKUP_CONFIG_FILE` environment variable. - The `BACKUP_CONFIG_FILE` environment variable.
@@ -89,7 +89,7 @@ services:
environment: environment:
## Specify the path to the configuration file ## Specify the path to the configuration file
- BACKUP_CONFIG_FILE=/backup/config.yaml - BACKUP_CONFIG_FILE=/backup/config.yaml
# Ensure the pg-bkup container is connected to the same network as your database # Ensure the mysql-bkup container is connected to the same network as your database
networks: networks:
- web - web

View File

@@ -42,7 +42,7 @@ It supports a variety of storage options and ensures data security through GPG e
## Use Cases ## Use Cases
- **Automated Recurring Backups:** Schedule regular backups for MySQL databases. - **Automated Recurring Backups:** Schedule regular backups for MySQL databases.
- **Cross-Environment Migration:** Easily migrate MySQL databases across different environments using supported storage options. - **Cross-Environment Migration:** Easily migrate MySQL databases across different environments using `migration` feature.
- **Secure Backup Management:** Protect your data with GPG encryption. - **Secure Backup Management:** Protect your data with GPG encryption.
--- ---

View File

@@ -251,6 +251,7 @@ func initBackupConfig(cmd *cobra.Command) *BackupConfig {
utils.GetEnv(cmd, "cron-expression", "BACKUP_CRON_EXPRESSION") utils.GetEnv(cmd, "cron-expression", "BACKUP_CRON_EXPRESSION")
utils.GetEnv(cmd, "path", "REMOTE_PATH") utils.GetEnv(cmd, "path", "REMOTE_PATH")
utils.GetEnv(cmd, "config", "BACKUP_CONFIG_FILE") utils.GetEnv(cmd, "config", "BACKUP_CONFIG_FILE")
utils.GetEnv(cmd, "dbname", "DB_NAME")
// Get flag value and set env // Get flag value and set env
remotePath := utils.GetEnvVariable("REMOTE_PATH", "SSH_REMOTE_PATH") remotePath := utils.GetEnvVariable("REMOTE_PATH", "SSH_REMOTE_PATH")
storage = utils.GetEnv(cmd, "storage", "STORAGE") storage = utils.GetEnv(cmd, "storage", "STORAGE")