- Clone to somewhere.
pip install --user -r requirements.txt
- Symlink
dbsnap.py
to your $PATH, e.g.ln -s $PWD/dbsnap.py /usr/local/bin/dbsnap
-
Set your current database using
dbsnap connect
, e.g.dbsnap connect mysql://user:password@localhost/dbname
Currently, only
mysql
is supported. If you leave the password empty (mysql://user:@host...
), you'll be prompted for it. If you leave out the colon (mysql://user@host...
), no password will be used.The full string (including password, if any), will be stored locally in a file (
~/.local/share/dbsnap/current
). -
Create a snapshot:
dbsnap snap
-
Break your database.
-
Restore your snapshot:
dbsnap restore
The
restore
command finds the latest snapshot for the current database. You can pass a name for the snapshot file tosnap
andrestore
commands to use a different one. Usedbsnap list
to see available snapshots of the current database, anddbsnap clear
to remove all of them.
This work is licensed under the MIT License. See LICENSE
for details.