How-To Sketch

How to backup a remote Firebird SQL database using GBAK

Ann Lynnworth Oct 2019

article image

The following BAT file may be of interest if your local machine is not too far away from the database server. It shows how to use the free GBAK utility to backup a remote Firebird SQL database, with the destination file landing locally.

This BAT syntax is for use on Windows.

:: backup-sample.bat

setlocal

set project=sample
set yyyymmdd=20191020

set fbroot=d:\Apps\FirebirdSQL\2.5\bin\

if NOT exist %fbroot%bin\gbak.exe ECHO "cannot find %fbroot%bin\gbak.exe"
if NOT exist %fbroot%bin\gbak.exe pause

:: define target folder 
set bakdir=c:\fbtemp\
mkdir %bakdir%

cls

:: FYI syntax for the source when db is local
set DBName=c:\santral\data\santral.fdb

:: syntax for remote db using alias, server:alias
set DBName=sql332.href.com:sample01

set u=SYSDBA
set p=masterkey

REM gbak -user -password
REM -t transportable format

"%fbroot%bin\gbak.exe" -t -z -user %u% -password %p% %DBName% %bakdir%%project%_bak_%yyyymmdd%.fbk 
if errorlevel 1 pause


dir %bakdir%
pause

endlocal
Article Keywords:

Company publishing this blog in 2022: HREF Tools Corp. based in Wilmington, Delaware USA Privacy