| #FAQ: 10050-EN, Date: 7/21/2003 How to automate the backup of the database of NewWayService 2 using the InterBase 6 "gbak" utility. |
| The information in this article applies to : NewWayService 2.x (English) NewWayService 2.x (French) Description The "gbak" utility included with InterBase 6 is a command line utility. This utility can be called from a script file and you can schedule the script from a task scheduler (Example of a task scheduler: the "schedule" service under Windows NT/2000/XP" or the "cron" daemon under Linux/Solaris).
Solution Example #1: (Windows script file, local database) The following example backup the NewWayService 2 database file ("nws.ib") located in the "C:\Program Files\OroLogic\NewWayService2" folder and create the "nws.gbk" backup file in the same folder. The "gbak" utility is installed in the "C:\Program Files\Borland\InterBase" folder. The script file is called from the same computer where the database is located. Note that the line containing the "gbak" command must be typed on only one line. REM BEGIN OF SCRIPT FILE "C:\Program Files\Borland\InterBase\bin\gbak" -B -USER SYSDBA -PASSWORD masterkey "C:\Program Files\OroLogic\NewWayService2\nws.ib" "C:\Program Files\OroLogic\NewWayService2\nws.gbk" REM END OF SCRIPT FILE The "-B" parameter indicates to the "gbak" utility to do a backup. The "-USER" parameter indicates the InterBase username to use. In this case, the username "SYSDBA" is used (Not to confuse with technician codes of NewWayService 2). The "-PASSWORD" parameter indicates the InterBase username password. By default, the password of the InterBase "SYSDBA" user is "masterkey". Example #2: (Windows script file, database on a remote server and the TCP/IP protocol used) The following example backup the NewWayService 2 database file ("nws.ib") located in the "C:\Program Files\OroLogic\NewWayService2" folder of the "WIN1" server and create the "nws.gbk" backup file in the same folder. The "gbak" utility is installed in the "C:\Program Files\Borland\InterBase" folder of the computer where the script is called from. Since the "gbak" utility is called from a remote compuer and the TCP/IP protocol will be used, notice that the syntax used is different to specify the database to be backed up. REM BEGIN OF SCRIPT FILE "C:\Program Files\Borland\InterBase\bin\gbak" -B -USER SYSDBA -PASSWORD masterkey "WIN1:C:\Program Files\OroLogic\NewWayService2\nws.ib" "C:\Program Files\OroLogic\NewWayService2\nws.gbk" REM END OF SCRIPT FILE Example #3: (Windows script file, database on a remote server and the NamedPipe/NetBEUI protocol used) The following example backup the NewWayService 2 database file ("nws.ib") located in the "C:\Program Files\OroLogic\NewWayService2" folder of the "WIN1" server and create the "nws.gbk" backup file in the same folder. The "gbak" utility is installed in the "C:\Program Files\Borland\InterBase" folder of the computer where the script is called from. Since the "gbak" utility is called from a remote compuer and the NamedPipe/NetBEUI protocol will be used, notice that the syntax used is different to specify the database to be backed up. REM BEGIN OF SCRIPT FILE "C:\Program Files\Borland\InterBase\bin\gbak" -B -USER SYSDBA -PASSWORD masterkey "\\WIN1\C:\Program Files\OroLogic\NewWayService2\nws.ib" "C:\Program Files\OroLogic\NewWayService2\nws.gbk" REM END OF SCRIPT FILE Example #4: (Linux/Solaris script file, local database) The following example backup the NewWayService 2 database file ("nws.ib") located in the "/home/newwayservice" folder of a Linux/Solaris server and create the "nws.gbk" backup file in the same folder. The "gbak" utility is installed in the "/opt/interbase" folder of the Linux/Solaris server. The script file is called from the same server where the database is located on. # BEGIN OF SCRIPT FILE /opt/interbase/bin/gbak -b -user SYSDBA -password masterkey /home/newwayservice/nws.ib /home/newwayservice/nws.gbk # END OF SCRIPT FILE Example #5: (Linux/Solaris script file, database on a remote server and the TCP/IP protocol used) The following example backup the NewWayService 2 database file ("nws.ib") located in the "/home/newwayservice" folder of the "linux1" server and create the "nws.gbk" backup file in the same folder. The "gbak" utility is installed in the "/opt/interbase" folder of the computer where the script is called from. Since the "gbak" utility is called from a remote computer and the TCP/IP protocol will be used, notice that the syntax used is different to specify the database to be backed up. # BEGIN OF SCRIPT FILE /opt/interbase/bin/gbak -b -user SYSDBA -password masterkey linux1:/home/newwayservice/nws.ib /home/newwayservice/nws.gbk # END OF SCRIPT FILE The "gbak" utility can be ran from a "Windows" computer and make a backup of a database on a Linux/Solaris server. The opposite can also to be made (run the "gbak" utility from a Linux/Solaris computer and make a backup of a database on a "Windows" server). The following example run a script from a Windows computer and make a backup of a database located on a Linux/Solaris server: Example #6: (Windows script file, database on a remote server and the TCP/IP protocol used) REM BEGIN OF SCRIPT FILE "C:\Program Files\Borland\InterBase\bin\gbak" -B -USER SYSDBA -PASSWORD masterkey "linux1:/home/newwayservice/nws.ib" "/home/newwayservice/nws.gbk" REM END OF SCRIPT FILE Remarks: The backup copy can be made while other users of NewWayService 2 use the software. Note however that the modifications made by other users to the database after the backup is started will not be backed up. Note that a ".gbk" file is a special file format of INTERBASE 6. To be able to restore a database for a ".gbk" file, you MUST restore the file using the utility "NewWayService 2 database utility" or the utility "gbak" of INTERBASE 6. Rename a file from ".gbk" to ".ib" will not give good results. For more information on the "gbak" utility, refer to the InterBase 6 documentation. For more information on batch files, refer to the documentation of your operating system on which INTERBASE 6 is installed. After the backup of your database, we recommend you to store a copy of your backup file on tape or other media. For further information on tape or other media to use for storage, ask your computer’s sales representative Status Information
|
| © 1996-2008 OroLogic Inc. |