2017 © Pedro Peláez
 

symfony-bundle dropbox-backup-bundle

Allows backing up your mysql database to dropbox using symfony console

image

kachkaev/dropbox-backup-bundle

Allows backing up your mysql database to dropbox using symfony console

  • Wednesday, December 2, 2015
  • by kachkaev
  • Repository
  • 2 Watchers
  • 7 Stars
  • 202 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

KachkaevDropboxBackupBundle

This bundle allows you backing up your mysql database to dropbox using symfony console command., (*1)

Uses modified version of DropboxUploader by hakre., (*2)

IMPORTANT, (*3)

This repository is abandoned and has not been updated since 2013. Please enjoy these alternatives with a far greater functionality: * https://github.com/kbond/php-backup * https://github.com/dizda/CloudBackupBundle, (*4)

Installation

Composer

Add the following dependency to your project’s composer.json file:, (*5)

    "require": {
        // ...
        "kachkaev/dropbox-backup-bundle": "dev-master"
        // ...
    }

Now tell composer to download the bundle by running the command:, (*6)

$ php composer.phar update kachkaev/dropbox-backup-bundle

Composer will install the bundle to vendor/kachkaev directory., (*7)

Adding bundle to your application kernel

// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Kachkaev\DropboxBackupBundle\KachkaevDropboxBackupBundle(),
        // ...
    );
}

Configuration

Here is the default configuration for the bundle:, (*8)

kachkaev_dropbox_backup:  
    database:             

        # Only pdo_mysql is supported at the moment
        driver:               pdo_mysql 
        host:                 localhost 
        port:                 ~ 
        dbname:               ~ # Required
        user:                 ~ # Required
        password:             ~ # Required

        # Directory relative to Dropbox root
        output_directory:     

        # Output filename consists of prefix and timestamp
        output_fileprefix:    

        # Set to true to compress .sql to .tgz
        output_compression:   false 

    # Dropbox account credentials (use parameters in config.yml and store real values in prameters.yml)
    dropbox:              
        user:                 ~ # Required
        password:             ~ # Required

It is recommended to keep real values for logins and passwords in your parameters.yml file, e.g.:, (*9)

# app/config/config.yml
kachkaev_dropbox_backup:
    database:
        driver:   %database_driver%
        host:     %database_host%
        port:     %database_port%
        dbname:   %database_name%
        user:     %database_user%
        password: %database_password%

        output_directory: db-backup/
        output_fileprefix: db_
        output_compression: true
    dropbox:
        user: %dropbox_user%
        password: %dropbox_password%
# app/config/parameters.yml
    # ...
    database_driver: pdo_mysql
    database_host: localhost
    database_port: null
    database_name: myDatabase
    database_user: myLogin
    database_password: myDatabasePassword
    # ...
    dropbox_user: email@example.com
    dropbox_password: myDropboxPassword
    # ...

Usage

The bundle adds one command to symfony console: app/console dropbox_backup:database which you execute periodically as a cron job. For example the following cron command dumps your database every 3 hours on a machine with FreeBSD:, (*10)

# /var/cron/tabs/root
0       */03    *       *       *       cd /path/to/symfony_project/root_dir && su -m symfony_user -c 'app/console dropbox_backup:database --env=prod'

At the moment the bundle only works with a single mysql database, but more database types can be added if there is a demand. In addition, the bundle can be extended to backup content. not only the database., (*11)

The Versions

02/12 2015

dev-master

9999999-dev http://github.com/kachkaev/KachkaevDropboxBackupBundle

Allows backing up your mysql database to dropbox using symfony console

  Sources   Download

MIT

The Requires

 

database mysql dump dropbox