badpixxel / paddock-backups
Paddock - Backups Extension
Package info
gitlab.com/paddock-project/paddock-backups
Type:bundle
pkg:composer/badpixxel/paddock-backups
Requires
- php: ^7.4|^8.0
- ext-zip: *
- badpixxel/paddock-core: ^4.0
- badpixxel/paddock-system: ^4.0
Requires (Dev)
- badpixxel/php-sdk: ^2.0
README
Paddock extension for data backups management: define backup operations (source → locations) in YAML, execute & restore them from the console, and monitor their status with a Paddock track.
Requirements
- PHP 8.1+ with
ext-zip badpixxel/paddock-core&badpixxel/paddock-system^5.0 (Symfony 5.4 → 8.x)rdiff-backupbinary for incremental rdiff locations (optional)
| Version | PHP | Paddock Core | Status |
|---|---|---|---|
| 5.x | ^8.1 | ^5.0 | Active |
| 4.x | ^7.4 | 4.x | Maintenance |
Installation
composer require badpixxel/paddock-backups
Configuration
Backup locations (destinations) are defined by the PADDOCK_BACKUP
environment variable, as ;-separated DSNs:
# One Zip Location & one Plain Files Location
PADDOCK_BACKUP="zip://localhost/var/backups;file://localhost/mnt/nas/backups"
| Scheme | Location Type |
|---|---|
file:// | Plain files copy (mirror) |
zip:// | Zip archive |
rdiff:// | Incremental rdiff-backup |
Backup operations (sources) are defined in your Paddock configuration:
backups:
my-website:
description: "Website Files Backup"
source: "file://localhost/var/www/my-website"
tracks:
backups-status:
collector: "backup-status"
description: "Check Backups Status"
rules:
my-website: { ne: true, eq: "Ok" }
Console Commands
| Command | Description |
|---|---|
paddock:backup | Execute backup operations |
paddock:restore | Restore a backup |
paddock:backup:status | Display status of all backup operations |
paddock:backup:sources | List available backup sources types |
paddock:backup:locations | List available backup locations types |
# Execute a single operation, without interaction
php bin/paddock paddock:backup --operation=my-website -n
The backup-status collector exposes each operation status (Ok / errors)
so your monitoring (i.e NRPE) gets alerted when backups fail.
Development & Tests
All checks run identically in CI and locally: the GitLab pipeline executes the exact same commands as the docker containers (one per Symfony version, 5.4 → 8.x). The integration test executes a complete local backup operation (files source → zip location) through the real console commands:
# Start all containers & run everything (composer, quality, tests)
make verify
# Run PhpUnit tests in all containers
make test
# Quality suites (GrumPHP: lint, code style, PhpStan)
php vendor/bin/grumphp run --testsuite=travis
php vendor/bin/grumphp run --testsuite=csfixer
php vendor/bin/grumphp run --testsuite=phpstan
# PhpUnit testsuites
vendor/bin/phpunit --testsuite=integration
License
Paddock is released under the MIT License.