2017 © Pedro Peláez
 

library snapshot

Database snapshot application

image

linkorb/snapshot

Database snapshot application

  • Thursday, December 14, 2017
  • by joostfaassen
  • Repository
  • 3 Watchers
  • 3 Stars
  • 111 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 19 Versions
  • 2 % Grown

The README.md

Snapshot

Mysql snapshot utility, (*1)

Features

  • Backup single database, or all databases on a server, to Amazon S3
  • Compressesion
  • Encryption (GPG)
  • Supports multiple servers in single config
  • Supports multiple storage backends in single config
  • Simple database restore
  • Lists remote snapshots with wildcards

Configuration

Snapshot is configured using a snapshot.yml file., (*2)

The file will be automatically loaded from the current working directory, or from /etc/snapshot.yml., (*3)

You can also pass --config or -c to specify the exact config filename you wish to use., (*4)

To get you started, simply run:, (*5)

cp snapshot.yml.dist snapshot.yml

and edit snapshot.yml to fit your environment, (*6)

Example snapshot.yml

In the following config you'll find 2 configured database servers (server-a and server-b), and one storage backend (store1):, (*7)

workdir: /snapshot

servers:

  server-a:
    username: root
    password: super_secret_password
    address: 10.0.0.100
    port: 3306

  server-b:
    username: root
    password: mega_secret_password
    address: 10.0.0.101
    port: 3306


storage:
  store1:
    type: s3
    region: eu-west-1
    access_key: HELLO
    secret_key: SHHHHHHH
    bucket: my_bucket_name
    prefix: "snapshot/"
    gpg_password: s3cr3t

Usage examples:

Backing up a whole server:

The following command will backup all databases on server-a to store1., (*8)

bin/snapshot server:backup server-a store1

Backing up a single database:

The following command will backup database my_db on server-a to store1., (*9)

bin/snapshot database:backup server-a my_db store1

List remote snapshots

The following command will list all snapshots in store1., (*10)

bin/snapshot snapshot:list store1

The following command will list all snapshots in store1 matching a filter., (*11)

bin/snapshot snapshot:list store1 snapshot-a/*/my_db

Restoring backups

The following command will restore a backup of snapshot server-a/20160101/my_db from store1 onto server-b:, (*12)

bin/snapshot snapshot:restore store1 server-b server-a/20160101/my_db

License

MIT. Please refer to the license file for details., (*13)

Brought to you by the LinkORB Engineering team


Check out our other projects at linkorb.com/engineering., (*14)

Btw, we're hiring!, (*15)

The Versions

14/12 2017
01/03 2017
01/03 2017
18/01 2017
10/01 2017
28/12 2016
13/12 2016
13/12 2016
10/12 2016
08/12 2016
08/12 2016
08/12 2016
01/12 2016
04/10 2016
04/10 2016
02/10 2016