damascene / database-backup
This is just a small CLI app which will create a backup from your database
Fund package maintenance!
zaherg
Installs: 18
Dependents: 0
Suggesters: 0
Security: 0
Stars: 20
Watchers: 1
Forks: 0
Open Issues: 0
Type:project
Requires
- php: >=7.0.0
- nesbot/carbon: 1.22.1
- symfony/console: ^4.0
- symfony/filesystem: ^4.0
- symfony/finder: ^4.0
- symfony/process: ^4.0
- symfony/stopwatch: ^4.0
- symfony/yaml: ^4.0
- tightenco/collect: ^5.6
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.15.0
- humbug/box: ^3.8
- pds/skeleton: ~1.0
- roave/security-advisories: dev-master
Suggests
- league/flysystem: Required to use the remote backup with S3 or Dropbox (~1.0).
- league/flysystem-aws-s3-v3: Required to use the Flysystem S3 driver (~1.0).
- spatie/flysystem-dropbox: Required to use the Flysystem Dropbox driver (~1.0).
This package is auto-updated.
Last update: 2022-08-28 06:22:55 UTC
README
PS: This work was inspired by many people around me, especially backmeup which was created by Arda Kılıçdağı.
The idea
I wanted to have a small cli app that I can use to backup my databases whenever I need and with simple modifications, so I tried bach/shell and I didn't like it.
So to make the story short this is what I have done so far, this is just a small backup cli app that you can use on your server and run it via cron jobs to create a backup for all your databases or for one of them if you pass it as a parameter.
Currently implemented backup drivers:
- Local backup.
- Dropbox.
- Amazon.
Installation
Requirement
Remember that you need to have composer installed locally, if its not installed locally you can get it from getcomposer.org
Via git clone
Right now the best way to install it is to clone the repository
git clone https://github.com/linuxjuggler/database-backup.git
then execute the following commands
cd database-backup
composer install
Via composer
You can install it using composer by executing the following command:
composer create-project damascene/database-backup
Via composer (globally)
You can install it using composer by executing the following command:
composer global require damascene/database-backup
PS: if you run it globally you can just use backup
instead of ./bin/backup
.
Using the phar file
We distribute a PHP Archive (PHAR) that has all dependencies (including the suggested) of database backup bundled in a single file. You can find the file under the assets of each release.
After downloading the file remember to run the following commands:
$ mv backup ./bin/backup $ chmod u+x backup
Usage
- You should create the configuration file using the command:
./bin/backup init
You will be asked for few questions which the app is going to use them later.
- You can start the backup process using the command:
./bin/backup db:run --database my_database_name
if you didn't pass the database parameter it will backup all the databases.
- you can list all the backup files that you have using the command:
./bin/backup db:list
Upgrade
Based on how you have install it you can run one of the following commands:
- If installed via git:
from within your code directory run:
git pull origin master
- If installed via composer:
from within your code directory run:
composer update
- If installed via composer globally:
composer global update
- Finally check the file
config.yml.example
for the new updates if you don't want to use theinit
command.
TODO
- Add Tests