Project

snatchdb

0.0
No commit activity in last 3 years
No release in over 3 years
Remote database downloader
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

= 2.0.5
= 2.0.24
 Project Readme

Snatch¶ ↑

Snatch is a console tool to download a remote MySQL database dump via SSH protocol.

Does not require to install anything on server.

Installation¶ ↑

gem install snatchdb

Usage¶ ↑

To create a new snatch profile just type

snatch --new PROFILE_NAME

That will generate a sample YAML formatted profile in current directory. Use your favorite editor to change the server settings.

Sample config:

---
host: YOUR_HOSTNAME
user: YOUR_SSH_USER
password: YOUR_SSH_PASSWORD
db_user: MYSQL_USER
db_password: MYSQL_PASSWORD
db_list:
  - database1
  - database2

Parameters:

  • host: Remote server hostname

  • user: Remote server ssh user

  • password: Remote server ssh password (can leave as is if using ssh public key auth)

  • port: Retote server ssh server port (default: 22)

  • db_user: Local MySQL server username

  • db_password: MySQL server password (leave blank if no password)

  • db_list: List of all databases to dump

To download a dump type:

snatch /path/to/config.yml

Snatch is handling the following errors:

  • Invalid SSH credentials

  • Invalid MySQL credentials

  • Requested database is not found

If everything works fine you will get a file “host_timestamp.sql.gz” in your current directory. Just import into your mysql server and you’re ready to go.

Copyright © 2011 Dan Sosedoff.