Backup bundle
, (*1)
Usage
Add "nkt/backup-bundle": "1.0.x-dev"
into composer.json., (*2)
Add Nkt\BackupBundle\NktBackupBundle
into your kernel bundles., (*3)
Now you can add new cron job, for backup your application:, (*4)
0 */6 * * * /path/to/app/console doctrine:database:backup --gzip=-9
You can also restore any backup using, (*5)
/path/to/app/console doctrine:database:restore /path/to/app/backup/backupname.sql.gz
Backup options
Backup filename contains driver name, database name and date.
You can change date pattern (by default Y-m-d-H-i-s
)
using --date-pattern
option., (*6)
If you using multiply connections, specify it using --connection
option
or -c
flag., (*7)
By default all backups saves into path/to/app/backups
, you can change it
using --destination
option or -d
flag., (*8)
As you can see in example, you can compress backups using --gzip
option.
This option required value, you have to specify compress quality., (*9)
Restore options
Restore command required filename by first argument. It also support
change connection with --connection
option or -c
flag., (*10)
You don't have to specify gzipped file. Command checks does filename
ends with .gz
and decompress it., (*11)
License
MIT, (*12)