Subject Re: [firebird-support] Gbak cmd file - is this safe?
Author Stefan Heymann
Just to be on the safe side, I would delete the log files (backup2.txt
and backup3.txt) directly before calling GBAK. GBAK will not run if
the file provided with -y does exist.

You might want to add a -v to the GBAK call so there is a verbose
logging in your log files.

You might want to add a /c to your XCOPY call so copying continues for
the second file even when there is an error for the first.

Best Regards

Stefan





> Hi,

> I'm using the following cmd file to backup my live databases twice a day
> via a Windows Scheduled Event. Is it okay with the experts or am I
> leaving myself open for disaster?

> ===========================================
> C:\Firebird\bin\gbak.exe -t -g -co -user SYSDBA -password ******** -y
> c:\utils\backup2.txt 192.168.2.2:"C:\Documents And Settings\All
> Users\Documents\VOCALPOINT.FDB" D:\VOCALPOINT.FBK
> C:\Firebird\bin\gbak.exe -t -g -co -user SYSDBA -password ******** -y
> c:\utils\backup3.txt 192.168.2.100:"C:\Documents And Settings\All
> Users\Documents\VOCALPOINT.FDB" D:\VOCALPOINT_REMOTE.FBK
> if errorlevel 1 goto problem
> if errorlevel 0 goto exit
> :exit
> C:\usr\sbin\sendmail -messagefile=c:\utils\backup2.txt
> -subject="Completed Firebird Backup Notification" *******@**************
> del c:\utils\backup2.txt
> del c:\utils\backup3.txt
> j:
> xcopy "d:\*.fbk" /y
> exit
> :problem
> C:\usr\sbin\sendmail -messagefile=c:\utils\backup2.txt -subject="Failed
> Firebird Backup Notification" *******@**************
> del c:\utils\backup2.txt
> del c:\utils\backup3.txt
> exit
> ===========================================

> Thanks,

> Rob Davis




> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

> Visit http://www.firebirdsql.org and click the Resources item
> on the main (top) menu. Try Knowledgebase and FAQ links !

> Also search the knowledgebases at http://www.ibphoenix.com

> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Yahoo! Groups Links



>




--
Stefan Heymann
www.destructor.de/firebird