2017 © Pedro Peláez
 

project database-backup

This is just a small CLI app which will create a backup from your database

image

damascene/database-backup

This is just a small CLI app which will create a backup from your database

  • Tuesday, May 1, 2018
  • by zaher
  • Repository
  • 0 Watchers
  • 2 Stars
  • 13 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 14 Versions
  • 0 % Grown

The README.md

Database backup CLI app

PS: This work was inspired by many people around me, especially backmeup which was created by Arda Kılıçdağı., (*1)

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., (*2)

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., (*3)

Currently implemented backup drivers:

  1. Local backup.
  2. Dropbox.
  3. Amazon.

Installation

Requirement

Remember that you need to have composer installed locally, if its not installed locally you can get it from getcomposer.org, (*4)

Via git clone

Right now the best way to install it is to clone the repository, (*5)

git clone https://github.com/linuxjuggler/database-backup.git

then execute the following commands, (*6)

cd database-backup
composer install

Via composer

You can install it using composer by executing the following command:, (*7)

composer create-project damascene/database-backup

Via composer (globally)

You can install it using composer by executing the following command:, (*8)

composer global require damascene/database-backup

PS: if you run it globally you can just use backup instead of ./bin/backup., (*9)

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., (*10)

After downloading the file remember to run the following commands:, (*11)

$ 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., (*12)

  • 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., (*13)

  • 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:, (*14)

  • If installed via git:

from within your code directory run:, (*15)

git pull origin master
  • If installed via composer:

from within your code directory run:, (*16)

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 the init command.

TODO

  1. [ ] Add Tests

The Versions