Subject Re: I hate gbak - why isn't too comfortable ?
Author fabiano_bonin
Are you having these errors it in a RedHat/Fedora box?

I had **many** problems with redhat out-of-the-box kernel and
firebird. All problems are solved after a kernel upgrade.
The symptons are like yours: The backup happened ok, but the restore
always fails, each time in a different point.

If you are using Linux, i have a small script to run when you have a
corrupted database. It helped me many times. You
type 'firebird_recover.sh <database_name>' and it will backup your
database (with many special options) to /var/tmp/restored.fbk and
restore it to /var/tmp/restored.fdb, showing the 4 last lines of the
backup and restore logs.

firebird_recover.sh:

if [ "$1" = "" ]; then
echo "Usage: $0 <database_name>"
exit 0
fi

rm -f /var/tmp/backup.log
rm -f /var/tmp/restore.log

echo "Executing emergency backup of $1"
/opt/firebird/bin/gbak -backup -verify -ignore -garbage -limbo -
y /var/tmp/backup.log $1 /var/tmp/restored.fbk

echo "Last 4 lines of /var/tmp/backup.log:"
tail /var/tmp/backup.log -n 4

echo ""

echo "Restoring emergency backup in /var/tmp/restored.fdb"
/opt/firebird/bin/gbak -create -verify -replace -
y /var/tmp/restore.log /var/tmp/restored.fbk /var/tmp/restored.fdb

echo "Last 4 lines of /var/tmp/restore.log:"
tail /var/tmp/restore.log -n 4

chown firebird:firebird /var/tmp/restored.fdb