sonntagnacht / backup-bundle
command to take a snapshot of your project for symfony 2.8+
Installs: 170
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 3
Forks: 3
Open Issues: 2
Type:symfony-bundle
Requires
- php: >=5.6
- knplabs/knp-gaufrette-bundle: ~0.3
- sonntagnacht/toolbox-bundle: ^0.2
Requires (Dev)
- phpunit/phpunit: 3.7.*
- symfony/framework-standard-edition: ^2.8|3.*
This package is auto-updated.
Last update: 2025-02-12 23:09:17 UTC
README
This BackupBundle can create backups from type daily, weekly, monthly or yearly. It'll save your default database and GaufretteFilesystems to tar.gz-archive in a GaufretteFilesystem.
Installtion
Run composer require sonntagnacht/backup-bundle
to use SNBackupBundle in your Project.
Configuration
Add to AppKernel.php
class AppKernel extends Kernel { public function registerBundles() { $bundles = array( new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new Symfony\Bundle\SecurityBundle\SecurityBundle(), new Symfony\Bundle\TwigBundle\TwigBundle(), // ... new SN\BackupBundle\SNBackupBundle(), // ... return $bundles; } // ... }
config.yml
knp_gaufrette: ... filesystems: backup_fs: adapter: ... sn_backup: target_fs: backup_fs databases: - mydb # name of your doctrine database connection include_fs: - image_fs # names of gaufrette filesystems wich should backuped
Usage
To take a backup of your current webapplication (database and gaufrette filesystems)
php bin/console sn:backup:dump [daily|weekly|monthly|yearly]
For large Backups, we skipped an initial connection check because the connection might get lost until everything is stored in a tar
If you still want a check if the filesystem exists, execute the backup command with --check-target-fs
Get a list of all backups
php bin/console sn:backup:restore
Restore a saved backup
php bin/console sn:backup:restore [id]
Delete backups whiche are older than seven days.
php bin/console sn:backup:cleanup [daily|weekly|monthly|yearly] 7d
WebGUI
To use the webgui add following lines to routing.yml
SNBackupBundle: resource: "@SNBackupBundle/Controller/" type: annotation prefix: /backup