Last active
March 30, 2016 13:04
-
-
Save jbearden0/ae1674cda82fc55651e662e99aa28ba2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
user=secret | |
pass=secret | |
dbfile='/var/lib/firebird/2.5/data/rsgdata.gdb' | |
dbname=$(mktemp -u) | |
echo $dbname | |
echo "Stopping firebird..." | |
service firebird2.5-super stop | |
echo "Copying database..." | |
cp -f $dbfile /tmp/${dbname}.orig.gdb | |
echo "Starting firebird..." | |
service firebird2.5-super start | |
echo "Locking database..." | |
gfix -user $user -password $pass localhost:rsgdata -shut single -force 5 | |
echo "Backing up database..." | |
gbak -b localhost:rsgdata ${dbname}.bak.orig.gdb -user $user -pas $pass | |
echo "Restoring database..." | |
gbak -rep ${dbname}.bak.orig.gdb localhost:rsgdata -user $user -pas $pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment